diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-16 00:20:18 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-16 00:20:18 +0200 |
| commit | a83f6a2e53de7a9322755d68ebc9f13e3babecc2 (patch) | |
| tree | 599c2a5173f42d5a9b99e5cfdc1dcfe288bb2165 /src/debug.c | |
| parent | c85e4b4d2411e60af7387dec663ea62b03743eab (diff) | |
| download | ek-a83f6a2e53de7a9322755d68ebc9f13e3babecc2.tar.gz ek-a83f6a2e53de7a9322755d68ebc9f13e3babecc2.zip | |
rework
+ Kind of only a partial commit, but whatever, this history is pretty
ugly anyway
Diffstat (limited to 'src/debug.c')
| -rw-r--r-- | src/debug.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/debug.c b/src/debug.c index b110b9b..2c873a2 100644 --- a/src/debug.c +++ b/src/debug.c @@ -225,14 +225,9 @@ static void _type_str(FILE *fp, struct ast_node *type) break; } - case AST_TYPE_TYPEOF: { - fprintf(fp, "(typeof)"); - break; - } - case AST_TYPE_PRIMITIVE: { fprintf(fp, "%s", primitive_str(AST_PRIMITIVE_TYPE(type).type)); - break; + break; } default: @@ -271,11 +266,13 @@ char *type_str(struct ast_node *node) */ static void _call_str(FILE *f, struct ast_node *call) { - struct ast_node *id = call->_call.id; - const char *id_str = id->_id.id; - fprintf(f, "%s", id_str); + struct ast_node *expr = AST_CALL(call).expr; + if (expr->node_type == AST_ID) { + const char *id_str = AST_ID(expr).id; + fprintf(f, "%s", id_str); + } - struct ast_node *args = call->_call.args; + struct ast_node *args = AST_CALL(call).args; fprintf(f, "("); while (args) { |
