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
df6514ff
Commit
df6514ff
authored
Dec 14, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
5ae0cccf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+9
-2
No files found.
Cython/Compiler/Optimize.py
View file @
df6514ff
...
...
@@ -444,17 +444,24 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
else
:
return
node
new_node
.
value
=
new_node
.
constant_result
=
node
.
constant_result
new_node
=
new_node
.
coerce_to
(
node
.
type
,
self
.
module
_scope
)
new_node
=
new_node
.
coerce_to
(
node
.
type
,
self
.
current
_scope
)
return
new_node
# in the future, other nodes can have their own handler method here
# that can replace them with a constant result node
def
visit_ModuleNode
(
self
,
node
):
self
.
module
_scope
=
node
.
scope
self
.
current
_scope
=
node
.
scope
self
.
visitchildren
(
node
)
return
node
def
visit_FuncDefNode
(
self
,
node
):
old_scope
=
self
.
current_scope
self
.
current_scope
=
node
.
entry
.
scope
self
.
visitchildren
(
node
)
self
.
current_scope
=
old_scope
return
node
def
visit_Node
(
self
,
node
):
self
.
visitchildren
(
node
)
return
node
...
...
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