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
Gwenaël Samain
cython
Commits
67106b18
Commit
67106b18
authored
Aug 15, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cutoff argument to Node.dump() utility
parent
e500b59b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-2
No files found.
Cython/Compiler/Nodes.py
View file @
67106b18
...
@@ -176,10 +176,13 @@ class Node(object):
...
@@ -176,10 +176,13 @@ class Node(object):
self
.
_end_pos
=
pos
self
.
_end_pos
=
pos
return
pos
return
pos
def
dump
(
self
,
level
=
0
,
filter_out
=
(
"pos"
,)):
def
dump
(
self
,
level
=
0
,
filter_out
=
(
"pos"
,),
cutoff
=
100
):
if
cutoff
==
0
:
return
"<...nesting level cutoff...>"
def
dump_child
(
x
,
level
):
def
dump_child
(
x
,
level
):
if
isinstance
(
x
,
Node
):
if
isinstance
(
x
,
Node
):
return
x
.
dump
(
level
)
return
x
.
dump
(
level
,
filter_out
,
cutoff
-
1
)
elif
isinstance
(
x
,
list
):
elif
isinstance
(
x
,
list
):
return
"[%s]"
%
", "
.
join
([
dump_child
(
item
,
level
)
for
item
in
x
])
return
"[%s]"
%
", "
.
join
([
dump_child
(
item
,
level
)
for
item
in
x
])
else
:
else
:
...
...
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