summaryrefslogtreecommitdiff
path: root/src/codegen/codegen_stmt.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 12:54:33 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 12:54:33 +0000
commit7fea57bdddde04090cc95112b47d0a1a86c341bc (patch)
tree38b2f22583aff0af6f384f1b91accfd1bba7dc23 /src/codegen/codegen_stmt.c
parenteae6d2a789f6538806a3859a144e99558d3e6caf (diff)
Fix for #123
Diffstat (limited to 'src/codegen/codegen_stmt.c')
-rw-r--r--src/codegen/codegen_stmt.c7
1 files changed, 4 insertions, 3 deletions
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
{