checkpoint: massive refactor
This commit is contained in:
@@ -22,8 +22,8 @@ def normal_func():
|
||||
tree = parser.parse(bytes(code, "utf8"))
|
||||
|
||||
def print_node(node, indent=0):
|
||||
print(" " * indent + f"{node.type} [{node.start_byte}-{node.end_byte}] " + (f"'{code[node.start_byte:node.end_byte]}'" if node.type in ["decorator", "comment", "identifier"] else ""))
|
||||
for child in node.children:
|
||||
print_node(child, indent + 1)
|
||||
print(" " * indent + f"{node.type} [{node.start_byte}-{node.end_byte}] " + (f"'{code[node.start_byte:node.end_byte]}'" if node.type in ["decorator", "comment", "identifier"] else ""))
|
||||
for child in node.children:
|
||||
print_node(child, indent + 1)
|
||||
|
||||
print_node(tree.root_node)
|
||||
|
||||
Reference in New Issue
Block a user