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
Gwenaël Samain
cython
Commits
27a95b9b
Commit
27a95b9b
authored
Jan 14, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cdef class ordering in the presence of pxi includes.
parent
e5642d0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+15
-2
No files found.
Cython/Compiler/Nodes.py
View file @
27a95b9b
...
@@ -380,7 +380,20 @@ class StatListNode(Node):
...
@@ -380,7 +380,20 @@ class StatListNode(Node):
def
analyse_declarations
(
self
,
env
):
def
analyse_declarations
(
self
,
env
):
#print "StatListNode.analyse_declarations" ###
#print "StatListNode.analyse_declarations" ###
base_classes
=
{}
base_classes
=
{}
for
stat
in
self
.
stats
:
def
flatten
(
stats
):
# Common case is trivial flatten.
if
not
[
stat
for
stat
in
stats
if
isinstance
(
stat
,
StatListNode
)]:
return
stats
else
:
all
=
[]
for
stat
in
stats
:
if
isinstance
(
stat
,
StatListNode
):
all
.
extend
(
flatten
(
stat
.
stats
))
else
:
all
.
append
(
stat
)
return
all
flattened
=
flatten
(
self
.
stats
)
for
stat
in
flattened
:
if
isinstance
(
stat
,
CClassDefNode
)
and
not
stat
.
base_class_module
:
if
isinstance
(
stat
,
CClassDefNode
)
and
not
stat
.
base_class_module
:
base_classes
[
stat
.
class_name
]
=
stat
.
base_class_name
base_classes
[
stat
.
class_name
]
=
stat
.
base_class_name
@
cached_function
@
cached_function
...
@@ -391,7 +404,7 @@ class StatListNode(Node):
...
@@ -391,7 +404,7 @@ class StatListNode(Node):
else
:
else
:
return
depth
(
base_class
)
+
1
return
depth
(
base_class
)
+
1
keyed_stats
=
[]
keyed_stats
=
[]
for
ix
,
stat
in
enumerate
(
self
.
stats
):
for
ix
,
stat
in
enumerate
(
flattened
):
if
isinstance
(
stat
,
CClassDefNode
):
if
isinstance
(
stat
,
CClassDefNode
):
key
=
20
,
depth
(
stat
.
class_name
),
ix
key
=
20
,
depth
(
stat
.
class_name
),
ix
else
:
else
:
...
...
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