(node, indent=0)
| 27 | |
| 28 | |
| 29 | def print_node(node, indent=0): |
| 30 | indents = " " * indent |
| 31 | if isinstance(node, ast.AST): |
| 32 | lineno = "row={}".format(node.lineno) if hasattr(node, "lineno") else "" |
| 33 | print(indents, "NODE", node.__class__.__name__, lineno) |
| 34 | for field in node._fields: |
| 35 | print(indents, "-", field) |
| 36 | f = getattr(node, field) |
| 37 | if isinstance(f, list): |
| 38 | for f2 in f: |
| 39 | print_node(f2, indent=indent + shift) |
| 40 | else: |
| 41 | print_node(f, indent=indent + shift) |
| 42 | else: |
| 43 | print(indents, "OBJ", node) |
| 44 | |
| 45 | |
| 46 | print_node(t) |
no test coverage detected