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
db6f5f53
Commit
db6f5f53
authored
Jun 23, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow TreeFragment to substitute lists of nodes
parent
9b1800ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
Cython/Compiler/TreeFragment.py
Cython/Compiler/TreeFragment.py
+3
-0
No files found.
Cython/Compiler/TreeFragment.py
View file @
db6f5f53
...
...
@@ -176,6 +176,8 @@ class TemplateTransform(VisitorTransform):
if
sub
is
not
None
:
pos
=
self
.
pos
if
pos
is
None
:
pos
=
node
.
pos
if
type
(
sub
)
is
list
:
return
[
ApplyPositionAndCopy
(
pos
)(
s
)
for
s
in
sub
]
return
ApplyPositionAndCopy
(
pos
)(
sub
)
else
:
return
self
.
visit_Node
(
node
)
# make copy as usual
...
...
@@ -201,6 +203,7 @@ class TemplateTransform(VisitorTransform):
return
sub
elif
isinstance
(
sub
,
PyrexTypes
.
BaseType
):
ret
.
type
=
sub
ret
.
declarator
=
ret
.
base_type
=
None
elif
isinstance
(
sub
,
CSimpleBaseTypeNode
):
ret
.
base_type
=
sub
ret
.
declarator
=
CNameDeclaratorNode
(
pos
=
node
.
pos
,
name
=
EncodedString
(
""
),
cname
=
None
)
...
...
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