From 7fea57bdddde04090cc95112b47d0a1a86c341bc Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sun, 25 Jan 2026 12:54:33 +0000 Subject: Fix for #123 --- src/codegen/codegen_stmt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/codegen/codegen_stmt.c') diff --git a/src/codegen/codegen_stmt.c b/src/codegen/codegen_stmt.c index 003ce42..ff8ea46 100644 --- a/src/codegen/codegen_stmt.c +++ b/src/codegen/codegen_stmt.c @@ -498,9 +498,10 @@ void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out, int us { if (is_string_literal) { - fprintf(out, "({ printf(\"%%s\", "); - codegen_expression(ctx, body, out); - fprintf(out, "); printf(\"\\n\"); 0; })"); + char *inner = body->literal.string_val; + char *code = process_printf_sugar(ctx, inner, 1, "stdout", NULL, NULL, 0); + fprintf(out, "%s;", code); + free(code); } else { -- cgit v1.2.3