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
398b0bbd
Commit
398b0bbd
authored
May 05, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use generator utility code inside GeneratorDefNode instead of YieldExprNode
parent
109185f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+0
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
398b0bbd
...
@@ -5253,7 +5253,6 @@ class YieldExprNode(ExprNode):
...
@@ -5253,7 +5253,6 @@ class YieldExprNode(ExprNode):
self
.
arg
.
analyse_types
(
env
)
self
.
arg
.
analyse_types
(
env
)
if
not
self
.
arg
.
type
.
is_pyobject
:
if
not
self
.
arg
.
type
.
is_pyobject
:
self
.
arg
=
self
.
arg
.
coerce_to_pyobject
(
env
)
self
.
arg
=
self
.
arg
.
coerce_to_pyobject
(
env
)
env
.
use_utility_code
(
generator_utility_code
)
def
generate_evaluation_code
(
self
,
code
):
def
generate_evaluation_code
(
self
,
code
):
self
.
label_name
=
code
.
new_label
(
'resume_from_yield'
)
self
.
label_name
=
code
.
new_label
(
'resume_from_yield'
)
...
...
Cython/Compiler/Nodes.py
View file @
398b0bbd
...
@@ -2989,6 +2989,9 @@ class GeneratorDefNode(DefNode):
...
@@ -2989,6 +2989,9 @@ class GeneratorDefNode(DefNode):
code
.
putln
(
"return (PyObject *) %s;"
%
Naming
.
cur_scope_cname
);
code
.
putln
(
"return (PyObject *) %s;"
%
Naming
.
cur_scope_cname
);
def
generate_function_definitions
(
self
,
env
,
code
):
def
generate_function_definitions
(
self
,
env
,
code
):
from
ExprNodes
import
generator_utility_code
env
.
use_utility_code
(
generator_utility_code
)
self
.
gbody
.
generate_function_header
(
code
,
proto
=
True
)
self
.
gbody
.
generate_function_header
(
code
,
proto
=
True
)
super
(
GeneratorDefNode
,
self
).
generate_function_definitions
(
env
,
code
)
super
(
GeneratorDefNode
,
self
).
generate_function_definitions
(
env
,
code
)
self
.
gbody
.
generate_function_definitions
(
env
,
code
)
self
.
gbody
.
generate_function_definitions
(
env
,
code
)
...
...
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