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
Kirill Smelkov
cython
Commits
85bb6796
Commit
85bb6796
authored
Oct 04, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More complete array type parsing.
Also fixed passing templates through complex types.
parent
9b24fd97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+13
-13
No files found.
Cython/Compiler/Parsing.py
View file @
85bb6796
...
...
@@ -2009,7 +2009,7 @@ def p_c_base_type(s, self_flag = 0, nonempty = 0, templates = None):
# If self_flag is true, this is the base type for the
# self argument of a C method of an extension type.
if
s
.
sy
==
'('
:
return
p_c_complex_base_type
(
s
)
return
p_c_complex_base_type
(
s
,
templates
=
templates
)
else
:
return
p_c_simple_base_type
(
s
,
self_flag
,
nonempty
=
nonempty
,
templates
=
templates
)
...
...
@@ -2024,20 +2024,21 @@ def p_calling_convention(s):
calling_convention_words
=
cython
.
declare
(
set
,
set
([
"__stdcall"
,
"__cdecl"
,
"__fastcall"
]))
def
p_c_complex_base_type
(
s
):
def
p_c_complex_base_type
(
s
,
templates
=
None
):
# s.sy == '('
pos
=
s
.
position
()
s
.
next
()
base_type
=
p_c_base_type
(
s
)
base_type
=
p_c_base_type
(
s
,
templates
=
templates
)
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
s
.
expect
(
')'
)
complex_typ
e
=
Nodes
.
CComplexBaseTypeNode
(
pos
,
type_nod
e
=
Nodes
.
CComplexBaseTypeNode
(
pos
,
base_type
=
base_type
,
declarator
=
declarator
)
while
s
.
sy
==
'['
:
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
complex_type
=
Nodes
.
CComplexBaseTypeNode
(
pos
,
base_type
=
complex_type
,
declarator
=
declarator
)
return
complex_type
if
s
.
sy
==
'['
:
if
is_memoryviewslice_access
(
s
):
type_node
=
p_memoryviewslice_access
(
s
,
type_node
)
else
:
type_node
=
p_buffer_or_template
(
s
,
type_node
,
templates
)
return
type_node
def
p_c_simple_base_type
(
s
,
self_flag
,
nonempty
,
templates
=
None
):
...
...
@@ -2110,10 +2111,6 @@ def p_c_simple_base_type(s, self_flag, nonempty, templates = None):
type_node
=
p_memoryviewslice_access
(
s
,
type_node
)
else
:
type_node
=
p_buffer_or_template
(
s
,
type_node
,
templates
)
while
s
.
sy
==
'['
:
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
type_node
=
Nodes
.
CComplexBaseTypeNode
(
pos
,
base_type
=
type_node
,
declarator
=
declarator
)
if
s
.
sy
==
'.'
:
s
.
next
()
...
...
@@ -2132,6 +2129,9 @@ def p_buffer_or_template(s, base_type_node, templates):
p_positional_and_keyword_args
(
s
,
(
']'
,),
templates
)
)
s
.
expect
(
']'
)
if
s
.
sy
==
'['
:
base_type_node
=
p_buffer_or_template
(
s
,
base_type_node
,
templates
)
keyword_dict
=
ExprNodes
.
DictNode
(
pos
,
key_value_pairs
=
[
...
...
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