Show More
@@ -94,17 +94,17 b' class parser(object):' | |||
|
94 | 94 | return self.eval(t) |
|
95 | 95 | return t |
|
96 | 96 | |
|
97 | def prettyformat(tree, leafnodes): | |
|
98 | def _prettyformat(tree, level, lines): | |
|
97 | def _prettyformat(tree, leafnodes, level, lines): | |
|
99 | 98 |
|
|
100 | 99 |
|
|
101 | 100 |
|
|
102 | 101 |
|
|
103 | 102 |
|
|
104 |
|
|
|
103 | _prettyformat(s, leafnodes, level + 1, lines) | |
|
105 | 104 |
|
|
106 | 105 | |
|
106 | def prettyformat(tree, leafnodes): | |
|
107 | 107 | lines = [] |
|
108 | _prettyformat(tree, 0, lines) | |
|
108 | _prettyformat(tree, leafnodes, 0, lines) | |
|
109 | 109 | output = '\n'.join((' ' * l + s) for l, s in lines) |
|
110 | 110 | return output |
General Comments 0
You need to be logged in to leave comments.
Login now