diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-09 03:03:25 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-09 03:03:25 +0300 |
| commit | f86cb1e9ec6cb562d1d0ebf4b0fd7119296ff10d (patch) | |
| tree | 76491876cb97145397c115b5ce1ade1f48ab6215 | |
| parent | 25d4373bc582c26aa7a63e83ca50eb7197689ca7 (diff) | |
| download | ek-f86cb1e9ec6cb562d1d0ebf4b0fd7119296ff10d.tar.gz ek-f86cb1e9ec6cb562d1d0ebf4b0fd7119296ff10d.zip | |
fix ast dumping
| -rw-r--r-- | src/ast.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -352,15 +352,19 @@ void ast_dump(int depth, struct ast *n) depth++; - if (n->t) - type_dump_list(n->t); + if (n->t) { + printf(" ("); type_dump_list(n->t); printf(")"); + } + + if (n->t2) + type_dump_list(n->t2); printf("\n"); if (n->s) dump(depth, "%s\n", n->s); - if (n->k == AST_CONST_INT) + if (is_const(n)) dump(depth, "%lli\n", n->v); if (n->a0) @@ -374,10 +378,6 @@ void ast_dump(int depth, struct ast *n) if (n->a3) ast_dump_list(depth, n->a3); - - if (n->t2) { - type_dump_list(n->t2); printf("\n"); - } } void ast_dump_list(int depth, struct ast *root) |
