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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
02d01c5c
Commit
02d01c5c
authored
4 years ago
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add recursive iterator for nested cypclasses
parent
f79ef7e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
Cython/Compiler/CypclassWrapper.py
Cython/Compiler/CypclassWrapper.py
+13
-5
No files found.
Cython/Compiler/CypclassWrapper.py
View file @
02d01c5c
...
...
@@ -24,17 +24,25 @@
#
def
cypclass_iter
(
scope
):
"""
Recursively iterate over nested cypclasses
"""
for
entry
in
scope
.
cypclass_entries
:
yield
entry
cypclass_scope
=
entry
.
type
.
scope
if
cypclass_scope
:
for
e
in
cypclass_iter
(
cypclass_scope
):
yield
e
def
generate_cypclass_typeobj_declarations
(
env
,
code
,
definition
):
"""
Generate declarations of global pointers to the PyTypeObject for each cypclass
"""
for
entry
in
env
.
cypclass_entries
:
for
entry
in
cypclass_iter
(
env
)
:
if
definition
or
entry
.
defined_in_pxd
:
code
.
putln
(
"static PyTypeObject *%s = 0;"
%
(
entry
.
type
.
typeptr_cname
))
cyp_scope
=
entry
.
type
.
scope
if
cyp_scope
:
# generate declarations for nested cycplasses
generate_cypclass_typeobj_declarations
(
cyp_scope
,
code
,
definition
)
This diff is collapsed.
Click to expand it.
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