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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
7bf54221
Commit
7bf54221
authored
Apr 27, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error messages in ctypedefs
parent
47ce63c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+17
-2
No files found.
Cython/Compiler/Parsing.py
View file @
7bf54221
...
...
@@ -2024,10 +2024,12 @@ def looking_at_expr(s):
name
=
s
.
systring
dotted_path
=
[]
s
.
next
()
while
s
.
sy
==
'.'
:
s
.
next
()
dotted_path
.
append
(
s
.
systring
)
s
.
expect
(
'IDENT'
)
saved
=
s
.
sy
,
s
.
systring
if
s
.
sy
==
'IDENT'
:
is_type
=
True
...
...
@@ -2043,12 +2045,14 @@ def looking_at_expr(s):
s
.
next
()
is_type
=
s
.
sy
==
']'
s
.
put_back
(
*
saved
)
dotted_path
.
reverse
()
for
p
in
dotted_path
:
s
.
put_back
(
'IDENT'
,
p
)
s
.
put_back
(
'.'
,
'.'
)
s
.
put_back
(
'IDENT'
,
name
)
return
not
is_type
return
not
is_type
and
saved
[
0
]
else
:
return
True
...
...
@@ -2066,6 +2070,17 @@ def looking_at_dotted_name(s):
else
:
return
0
def
looking_at_call
(
s
):
"See if we're looking at a.b.c("
# Don't mess up the original position, so save and restore it.
# Unfortunately there's no good way to handle this, as a subsequent call
# to next() will not advance the position until it reads a new token.
position
=
s
.
start_line
,
s
.
start_col
result
=
looking_at_expr
(
s
)
==
'('
if
not
result
:
s
.
start_line
,
s
.
start_col
=
position
return
result
basic_c_type_names
=
(
"void"
,
"char"
,
"int"
,
"float"
,
"double"
,
"bint"
)
special_basic_c_types
=
{
...
...
@@ -2606,7 +2621,7 @@ def p_ctypedef_statement(s, ctx):
return
p_c_enum_definition
(
s
,
pos
,
ctx
)
else
:
return
p_c_struct_or_union_definition
(
s
,
pos
,
ctx
)
elif
looking_at_
expr
(
s
):
elif
looking_at_
call
(
s
):
# ctypedef cython.fused_types(int, long) integral
if
s
.
sy
==
'IDENT'
:
funcname
=
[
s
.
systring
]
...
...
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