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
db5d5a41
Commit
db5d5a41
authored
Dec 30, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when base classes were declared out-of-order.
parent
d60b3659
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+19
-0
No files found.
Cython/Compiler/Nodes.py
View file @
db5d5a41
...
...
@@ -25,6 +25,7 @@ from Code import UtilityCode
from
StringEncoding
import
EncodedString
,
escape_byte_string
,
split_string_literal
import
Options
import
DebugFlags
from
Cython.Utils
import
cached_function
absolute_path_length
=
0
...
...
@@ -378,7 +379,25 @@ class StatListNode(Node):
def
analyse_declarations
(
self
,
env
):
#print "StatListNode.analyse_declarations" ###
base_classes
=
{}
for
stat
in
self
.
stats
:
if
isinstance
(
stat
,
CClassDefNode
)
and
not
stat
.
base_class_module
:
base_classes
[
stat
.
class_name
]
=
stat
.
base_class_name
@
cached_function
def
depth
(
class_name
):
base_class
=
base_classes
.
get
(
class_name
)
if
class_name
is
None
:
return
0
else
:
return
depth
(
base_class
)
+
1
keyed_stats
=
[]
for
ix
,
stat
in
enumerate
(
self
.
stats
):
if
isinstance
(
stat
,
CClassDefNode
):
key
=
20
,
depth
(
stat
.
class_name
),
ix
else
:
key
=
10
,
ix
keyed_stats
.
append
((
key
,
stat
))
for
key
,
stat
in
sorted
(
keyed_stats
):
stat
.
analyse_declarations
(
env
)
def
analyse_expressions
(
self
,
env
):
...
...
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