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
Xavier Thompson
cython
Commits
5a318f7c
Commit
5a318f7c
authored
Aug 13, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for cdef generators error
parent
0ea50f34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+11
-13
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
5a318f7c
...
@@ -1866,26 +1866,24 @@ class MarkClosureVisitor(CythonTransform):
...
@@ -1866,26 +1866,24 @@ class MarkClosureVisitor(CythonTransform):
collector
.
visitchildren
(
node
)
collector
.
visitchildren
(
node
)
if
collector
.
yields
:
if
collector
.
yields
:
if
isinstance
(
node
,
Nodes
.
CFuncDefNode
):
# Will report error later
return
node
for
i
,
yield_expr
in
enumerate
(
collector
.
yields
):
for
i
,
yield_expr
in
enumerate
(
collector
.
yields
):
yield_expr
.
label_num
=
i
+
1
yield_expr
.
label_num
=
i
+
1
gbody
=
Nodes
.
GeneratorBodyDefNode
(
pos
=
node
.
pos
,
gbody
=
Nodes
.
GeneratorBodyDefNode
(
name
=
node
.
name
,
pos
=
node
.
pos
,
name
=
node
.
name
,
body
=
node
.
body
)
body
=
node
.
body
)
generator
=
Nodes
.
GeneratorDefNode
(
generator
=
Nodes
.
GeneratorDefNode
(
pos
=
node
.
pos
,
pos
=
node
.
pos
,
name
=
node
.
name
,
args
=
node
.
args
,
name
=
node
.
name
,
star_arg
=
node
.
star_arg
,
starstar_arg
=
node
.
starstar_arg
,
args
=
node
.
args
,
doc
=
node
.
doc
,
decorators
=
node
.
decorators
,
star_arg
=
node
.
star_arg
,
gbody
=
gbody
,
lambda_name
=
node
.
lambda_name
)
starstar_arg
=
node
.
starstar_arg
,
doc
=
node
.
doc
,
decorators
=
node
.
decorators
,
gbody
=
gbody
,
lambda_name
=
node
.
lambda_name
)
return
generator
return
generator
return
node
return
node
def
visit_CFuncDefNode
(
self
,
node
):
def
visit_CFuncDefNode
(
self
,
node
):
self
.
visit
children
(
node
)
self
.
visit
_FuncDefNode
(
node
)
if
node
.
needs_closure
:
if
node
.
needs_closure
:
error
(
node
.
pos
,
"closures inside cdef functions not yet supported"
)
error
(
node
.
pos
,
"closures inside cdef functions not yet supported"
)
return
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