Skip to content

Commit f119e5d

Browse files
committed
ast fix dump tree
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent d8d4ca7 commit f119e5d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/vancode/interpreter/ast.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ proc treeRepr*(node: Node): string =
220220
of nkString: result = "String " & escape(node.stringVal)
221221
of nkIdent: result = "Ident " & node.ident
222222
else:
223-
result = ($node.kind)[2..^1]
223+
result = $node.kind
224+
if result.startsWith("nk"):
225+
result = result[2..^1]
224226
var children = ""
225227
for i, child in node.children:
226228
children.add('\n' & child.treeRepr)

0 commit comments

Comments
 (0)