ast: add printing of Variable Expr

This commit is contained in:
Luna 2019-08-24 17:25:08 -03:00
parent d93adbbd3e
commit 7c4aa04b00
2 changed files with 4 additions and 2 deletions

View file

@ -9,5 +9,5 @@ fn main(a int) int {
1 + 2 + 3 + 4
1 + 1 * 1
3 / (51 + 2)
println(2 * 1956)
println(2 * 1956 + a)
}

View file

@ -199,7 +199,9 @@ pub fn printExpr(expr: *Expr) void {
}
},
else => std.debug.warn("EXPR_UNKNOWN"),
.Variable => |token| std.debug.warn("{}", token.lexeme),
else => std.debug.warn("UnknownExpr-{}", @tagName(expr.*)),
}
}