Skip to content

Commit 957ab89

Browse files
committed
Remove _print_tree()
1 parent 8f42831 commit 957ab89

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

main.py

-10
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ def lex(filename: str):
2121
print(f"({token.line}): {token_name}({token.text})")
2222

2323

24-
def _print_tree(node, parser, level=0):
25-
if node.getChildCount() == 0:
26-
print(" | " * level + str(node))
27-
else:
28-
rule_name = parser.ruleNames[node.getRuleIndex()]
29-
print(" | " * level + rule_name)
30-
for i in range(node.getChildCount()):
31-
_print_tree(node.getChild(i), parser, level + 1)
32-
33-
3424
@app.command()
3525
def parse(filename: str):
3626
"""Syntactic analysis"""

0 commit comments

Comments
 (0)