diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-02 19:29:33 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-02 19:29:33 -0500 |
| commit | b770cd8f596cd195ae263dae14acfce033fe1818 (patch) | |
| tree | df0368b7006f7b846925d530876502ff0a9c6176 /src/ast.c | |
| parent | Add initial support for arrays (also no testing) (diff) | |
| download | cup-b770cd8f596cd195ae263dae14acfce033fe1818.tar.xz cup-b770cd8f596cd195ae263dae14acfce033fe1818.zip | |
Handle OP_ASSIGN in `print_ast()`
Diffstat (limited to 'src/ast.c')
| -rw-r--r-- | src/ast.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) { |