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
a6071116
Commit
a6071116
authored
Jan 16, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better #include ordering
parent
11901f05
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+0
-7
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+5
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
a6071116
...
...
@@ -567,14 +567,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_includes
(
self
,
env
,
cimported_modules
,
code
):
includes
=
[]
for
module
in
cimported_modules
:
for
filename
in
module
.
include_files
:
if
filename
not
in
includes
:
includes
.
append
(
filename
)
for
filename
in
env
.
include_files
:
if
filename
not
in
includes
:
includes
.
append
(
filename
)
for
filename
in
includes
:
code
.
putln
(
'#include "%s"'
%
filename
)
def
generate_filename_table
(
self
,
code
):
...
...
Cython/Compiler/Nodes.py
View file @
a6071116
...
...
@@ -2545,7 +2545,7 @@ class CClassDefNode(ClassDefNode):
if
self
.
module
is
None
:
self
.
module
=
ModuleScope
(
self
.
module_name
,
None
,
env
.
context
)
self
.
module
.
has_extern_class
=
1
env
.
cimported_modules
.
append
(
self
.
module
)
env
.
add_imported_module
(
self
.
module
)
if
self
.
base_class_name
:
if
self
.
base_class_module
:
...
...
Cython/Compiler/Symtab.py
View file @
a6071116
...
...
@@ -905,6 +905,10 @@ class ModuleScope(Scope):
def add_imported_module(self, scope):
if scope not in self.cimported_modules:
self.cimported_modules.append(scope)
for m in scope.cimported_modules:
self.add_imported_module(m)
for filename in scope.include_files:
self.add_include_file(filename)
def add_imported_entry(self, name, entry, pos):
if entry not in self.entries:
...
...
@@ -935,7 +939,7 @@ class ModuleScope(Scope):
else:
entry = self.declare_var(name, py_object_type, pos)
entry.as_module = scope
self.
cimported_modules.append
(scope)
self.
add_imported_module
(scope)
return entry
def declare_var(self, name, type, pos,
...
...
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