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
c40bf20c
Commit
c40bf20c
authored
Aug 09, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor code beautification
parent
6c5c2b9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/Pipeline.py
Cython/Compiler/Pipeline.py
+8
-2
No files found.
Cython/Compiler/Pipeline.py
View file @
c40bf20c
...
...
@@ -55,6 +55,7 @@ def generate_pyx_code_stage_factory(options, result):
return
result
return
generate_pyx_code_stage
def
inject_pxd_code_stage_factory
(
context
):
def
inject_pxd_code_stage
(
module_node
):
for
name
,
(
statlistnode
,
scope
)
in
context
.
pxds
.
items
():
...
...
@@ -62,6 +63,7 @@ def inject_pxd_code_stage_factory(context):
return
module_node
return
inject_pxd_code_stage
def
use_utility_code_definitions
(
scope
,
target
,
seen
=
None
):
if
seen
is
None
:
seen
=
set
()
...
...
@@ -78,6 +80,7 @@ def use_utility_code_definitions(scope, target, seen=None):
elif
entry
.
as_module
:
use_utility_code_definitions
(
entry
.
as_module
,
target
,
seen
)
def
inject_utility_code_stage_factory
(
context
):
def
inject_utility_code_stage
(
module_node
):
use_utility_code_definitions
(
context
.
cython_scope
,
module_node
.
scope
)
...
...
@@ -85,11 +88,12 @@ def inject_utility_code_stage_factory(context):
# Note: the list might be extended inside the loop (if some utility code
# pulls in other utility code, explicitly or implicitly)
for
utilcode
in
module_node
.
scope
.
utility_code_list
:
if
utilcode
in
added
:
continue
if
utilcode
in
added
:
continue
added
.
append
(
utilcode
)
if
utilcode
.
requires
:
for
dep
in
utilcode
.
requires
:
if
not
dep
in
added
and
not
dep
in
module_node
.
scope
.
utility_code_list
:
if
dep
not
in
added
and
dep
not
in
module_node
.
scope
.
utility_code_list
:
module_node
.
scope
.
utility_code_list
.
append
(
dep
)
tree
=
utilcode
.
get_tree
()
if
tree
:
...
...
@@ -97,6 +101,7 @@ def inject_utility_code_stage_factory(context):
return
module_node
return
inject_utility_code_stage
class
UseUtilityCodeDefinitions
(
CythonTransform
):
# Temporary hack to use any utility code in nodes' "utility_code_definitions".
# This should be moved to the code generation phase of the relevant nodes once
...
...
@@ -120,6 +125,7 @@ class UseUtilityCodeDefinitions(CythonTransform):
self
.
process_entry
(
node
.
type_entry
)
return
node
#
# Pipeline factories
#
...
...
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