Pretty-print an AST to the given output stream.
(ast, indent=' ', stream=sys.stdout, initlevel=0)
| 12 | |
| 13 | |
| 14 | def printAst(ast, indent=' ', stream=sys.stdout, initlevel=0): |
| 15 | "Pretty-print an AST to the given output stream." |
| 16 | rec_node(ast, initlevel, indent, stream.write) |
| 17 | stream.write('\n') |
| 18 | |
| 19 | def rec_node(node, level, indent, write): |
| 20 | "Recurse through a node, pretty-printing it." |