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
Boxiang Sun
cython
Commits
3c2d9b37
Commit
3c2d9b37
authored
Dec 19, 2010
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove OldYieldExprNode
parent
1edfca8d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
29 deletions
+5
-29
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+0
-26
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+3
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
3c2d9b37
...
@@ -4947,32 +4947,6 @@ class LambdaNode(InnerFunctionNode):
...
@@ -4947,32 +4947,6 @@ class LambdaNode(InnerFunctionNode):
env
.
add_lambda_def
(
self
.
def_node
)
env
.
add_lambda_def
(
self
.
def_node
)
class
OldYieldExprNode
(
ExprNode
):
# XXX: remove me someday
#
# arg ExprNode the value to return from the generator
# label_name string name of the C label used for this yield
subexprs
=
[
'arg'
]
type
=
py_object_type
def
analyse_types
(
self
,
env
):
self
.
is_temp
=
1
if
self
.
arg
is
not
None
:
self
.
arg
.
analyse_types
(
env
)
if
not
self
.
arg
.
type
.
is_pyobject
:
self
.
arg
=
self
.
arg
.
coerce_to_pyobject
(
env
)
error
(
self
.
pos
,
"Generators are not supported"
)
def
generate_result_code
(
self
,
code
):
self
.
label_name
=
code
.
new_label
(
'resume_from_yield'
)
code
.
use_label
(
self
.
label_name
)
code
.
putln
(
"/* FIXME: save temporary variables */"
)
code
.
putln
(
"/* FIXME: return from function, yielding value */"
)
code
.
put_label
(
self
.
label_name
)
code
.
putln
(
"/* FIXME: restore temporary variables and */"
)
code
.
putln
(
"/* FIXME: extract sent value from closure */"
)
class
YieldExprNode
(
ExprNode
):
class
YieldExprNode
(
ExprNode
):
# Yield expression node
# Yield expression node
#
#
...
...
Cython/Compiler/Optimize.py
View file @
3c2d9b37
...
@@ -1167,7 +1167,7 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
...
@@ -1167,7 +1167,7 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
self
.
yield_nodes
=
[]
self
.
yield_nodes
=
[]
visit_Node
=
Visitor
.
TreeVisitor
.
visitchildren
visit_Node
=
Visitor
.
TreeVisitor
.
visitchildren
def
visit_
Old
YieldExprNode
(
self
,
node
):
def
visit_YieldExprNode
(
self
,
node
):
self
.
yield_nodes
.
append
(
node
)
self
.
yield_nodes
.
append
(
node
)
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
3c2d9b37
...
@@ -1332,6 +1332,9 @@ class YieldNodeCollector(TreeVisitor):
...
@@ -1332,6 +1332,9 @@ class YieldNodeCollector(TreeVisitor):
def
visit_DefNode
(
self
,
node
):
def
visit_DefNode
(
self
,
node
):
pass
pass
def
visit_GeneratorExpressionNode
(
self
,
node
):
pass
class
MarkClosureVisitor
(
CythonTransform
):
class
MarkClosureVisitor
(
CythonTransform
):
def
visit_ModuleNode
(
self
,
node
):
def
visit_ModuleNode
(
self
,
node
):
...
@@ -1374,7 +1377,6 @@ class MarkClosureVisitor(CythonTransform):
...
@@ -1374,7 +1377,6 @@ class MarkClosureVisitor(CythonTransform):
self
.
needs_closure
=
True
self
.
needs_closure
=
True
return
node
return
node
class
CreateClosureClasses
(
CythonTransform
):
class
CreateClosureClasses
(
CythonTransform
):
# Output closure classes in module scope for all functions
# Output closure classes in module scope for all functions
# that really need it.
# that really need it.
...
...
Cython/Compiler/Parsing.py
View file @
3c2d9b37
...
@@ -1029,7 +1029,7 @@ def p_testlist_comp(s):
...
@@ -1029,7 +1029,7 @@ def p_testlist_comp(s):
def
p_genexp
(
s
,
expr
):
def
p_genexp
(
s
,
expr
):
# s.sy == 'for'
# s.sy == 'for'
loop
=
p_comp_for
(
s
,
Nodes
.
ExprStatNode
(
loop
=
p_comp_for
(
s
,
Nodes
.
ExprStatNode
(
expr
.
pos
,
expr
=
ExprNodes
.
Old
YieldExprNode
(
expr
.
pos
,
arg
=
expr
)))
expr
.
pos
,
expr
=
ExprNodes
.
YieldExprNode
(
expr
.
pos
,
arg
=
expr
)))
return
ExprNodes
.
GeneratorExpressionNode
(
expr
.
pos
,
loop
=
loop
)
return
ExprNodes
.
GeneratorExpressionNode
(
expr
.
pos
,
loop
=
loop
)
expr_terminators
=
(
')'
,
']'
,
'}'
,
':'
,
'='
,
'NEWLINE'
)
expr_terminators
=
(
')'
,
']'
,
'}'
,
':'
,
'='
,
'NEWLINE'
)
...
...
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