Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
0a3154c3
Commit
0a3154c3
authored
May 23, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compilation failure when trying to analyse non-trivial non-type strings as types
parent
23c2bbf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-3
tests/run/cython3.pyx
tests/run/cython3.pyx
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
0a3154c3
...
...
@@ -1182,9 +1182,13 @@ def _analyse_name_as_type(name, pos, env):
hold_errors
()
from
TreeFragment
import
TreeFragment
pos
=
(
pos
[
0
],
pos
[
1
],
pos
[
2
]
-
7
)
declaration
=
TreeFragment
(
u"sizeof(%s)"
%
name
,
name
=
pos
[
0
].
filename
,
initial_pos
=
pos
)
sizeof_node
=
declaration
.
root
.
stats
[
0
].
expr
sizeof_node
=
sizeof_node
.
analyse_types
(
env
)
try
:
declaration
=
TreeFragment
(
u"sizeof(%s)"
%
name
,
name
=
pos
[
0
].
filename
,
initial_pos
=
pos
)
except
CompileError
:
sizeof_node
=
None
else
:
sizeof_node
=
declaration
.
root
.
stats
[
0
].
expr
sizeof_node
=
sizeof_node
.
analyse_types
(
env
)
release_errors
(
ignore
=
True
)
if
isinstance
(
sizeof_node
,
SizeofTypeNode
):
return
sizeof_node
.
arg_type
...
...
tests/run/cython3.pyx
View file @
0a3154c3
...
...
@@ -437,7 +437,7 @@ def int_literals():
print
(
cython
.
typeof
(
1
UL
))
print
(
cython
.
typeof
(
10000000000000
UL
))
def
annotation_syntax
(
a
:
"test"
,
b
:
"other"
=
2
)
->
"ret"
:
def
annotation_syntax
(
a
:
"test
new test
"
,
b
:
"other"
=
2
)
->
"ret"
:
"""
>>> annotation_syntax(1)
3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment