From 67106b183ee00d59bf863caf8d464ee2a12c5781 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Fri, 15 Aug 2008 21:22:09 +0200 Subject: [PATCH] Added cutoff argument to Node.dump() utility --- Cython/Compiler/Nodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index c006d71d..4717fee8 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -176,10 +176,13 @@ class Node(object): self._end_pos = 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): if isinstance(x, Node): - return x.dump(level) + return x.dump(level, filter_out, cutoff-1) elif isinstance(x, list): return "[%s]" % ", ".join([dump_child(item, level) for item in x]) else: -- 2.26.2