diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:14:48 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:14:48 +0000 |
| commit | 812fe9cbe124bf39a06f58a538c8c01f7402fb09 (patch) | |
| tree | 8ea1f8258714e7dd8916eb221006e45082a129bb /src/codegen/codegen_stmt.c | |
| parent | 22035400ed7b7fcda088a1a5b1ca6505b23bf63f (diff) | |
Fix for #110
Diffstat (limited to 'src/codegen/codegen_stmt.c')
| -rw-r--r-- | src/codegen/codegen_stmt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/codegen/codegen_stmt.c b/src/codegen/codegen_stmt.c index 54c6a14..406a6e5 100644 --- a/src/codegen/codegen_stmt.c +++ b/src/codegen/codegen_stmt.c @@ -475,7 +475,8 @@ void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out, int us // Check if body is a string literal (should auto-print). ASTNode *body = c->match_case.body; - int is_string_literal = (body->type == NODE_EXPR_LITERAL && body->literal.type_kind == 2); + int is_string_literal = + (body->type == NODE_EXPR_LITERAL && body->literal.type_kind == LITERAL_STRING); if (is_expr) { @@ -1576,7 +1577,7 @@ void codegen_node_single(ParserContext *ctx, ASTNode *node, FILE *out) } case NODE_EXPR_LITERAL: // String literal statement should auto-print - if (node->literal.type_kind == 2 || node->literal.type_kind == TOK_STRING) + if (node->literal.type_kind == LITERAL_STRING) { fprintf(out, " printf(\"%%s\\n\", "); codegen_expression(ctx, node, out); |
