aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 13:49:33 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 13:49:33 +0200
commit84e800f7f8a81cb022cce69c4d6faef8deb3a023 (patch)
tree57e1bfb4e7c5edfff3d059f9bc67879f2a100fac
parenta80f818de34a631b4b1c9c9e866c6f43de07d816 (diff)
downloadimp-84e800f7f8a81cb022cce69c4d6faef8deb3a023.tar.gz
imp-84e800f7f8a81cb022cce69c4d6faef8deb3a023.zip
[bugfix] print ast, assign
-rw-r--r--src/interpreter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interpreter.c b/src/interpreter.c
index 8176bad..ecf26bd 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -105,9 +105,10 @@ void ast_print(ASTNode *node, int depth) {
break;
}
case NT_ASSIGN: {
- printf("%*sASSIGN %s=%d\n", indent, "",
- node->u.d_assign.var->u.d_var.name,
- node->u.d_assign.aexp->u.d_int.val);
+ printf("%*sASSIGN %s=", indent, "",
+ node->u.d_assign.var->u.d_var.name);
+ ast_print(node->u.d_assign.aexp, 0);
+ printf("\n");
break;
}
case NT_SEQ: {