From 812fe9cbe124bf39a06f58a538c8c01f7402fb09 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 24 Jan 2026 12:14:48 +0000 Subject: Fix for #110 --- src/codegen/codegen_stmt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/codegen/codegen_stmt.c') 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); -- cgit v1.2.3