(table, indent=0)
| 57 | |
| 58 | |
| 59 | def print_table(table, indent=0): |
| 60 | indents = " " * indent |
| 61 | print(indents, "table:", table.get_name()) |
| 62 | print(indents, " ", "name:", table.get_name()) |
| 63 | print(indents, " ", "type:", table.get_type()) |
| 64 | print(indents, " ", "line:", table.get_lineno()) |
| 65 | print(indents, " ", "identifiers:", table.get_identifiers()) |
| 66 | print(indents, " ", "Syms:") |
| 67 | for sym in table.get_symbols(): |
| 68 | flags = [] |
| 69 | for flag_name in flag_names: |
| 70 | func = getattr(sym, flag_name) |
| 71 | if func(): |
| 72 | flags.append(flag_name) |
| 73 | print(indents, " sym:", sym.get_name(), "flags:", " ".join(flags)) |
| 74 | if table.has_children(): |
| 75 | print(indents, " ", "Child tables:") |
| 76 | for child in table.get_children(): |
| 77 | print_table(child, indent=indent + shift) |
| 78 | |
| 79 | |
| 80 | table = symtable.symtable(source, "a", "exec") |
no test coverage detected