From b770cd8f596cd195ae263dae14acfce033fe1818 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Wed, 2 Feb 2022 19:29:33 -0500 Subject: Handle OP_ASSIGN in `print_ast()` --- src/ast.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ast.c b/src/ast.c index f75e531..84aafca 100644 --- a/src/ast.c +++ b/src/ast.c @@ -144,6 +144,12 @@ static void do_print_ast(Node *node, int depth) printf(" "); } printf("}\n"); + } else if (node->type == OP_ASSIGN) { + printf("(= \n"); + do_print_ast(node->assign.var, depth + 1); + printf("%*s,\n", 2*depth, ""); + do_print_ast(node->assign.value, depth + 1); + printf("%*s)\n", 2*depth, ""); } else if (node->type == AST_FUNC) { dump_func(node, depth); } else if (node->type == AST_LITERAL) { -- cgit v1.2.3