diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-25 12:20:33 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-25 12:20:33 +0000 |
| commit | eae6d2a789f6538806a3859a144e99558d3e6caf (patch) | |
| tree | 1ba0f696c17879af7bec8e017ff1c1c81439d791 /src/parser/parser_expr.c | |
| parent | 2dc5214fd8bb6a1168e2f2b643a36043c36c908a (diff) | |
Further fix for #121
Diffstat (limited to 'src/parser/parser_expr.c')
| -rw-r--r-- | src/parser/parser_expr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parser/parser_expr.c b/src/parser/parser_expr.c index 50d96f0..0951475 100644 --- a/src/parser/parser_expr.c +++ b/src/parser/parser_expr.c @@ -3599,7 +3599,10 @@ ASTNode *parse_expr_prec(ParserContext *ctx, Lexer *l, Precedence min_prec) free(print_code); ASTNode *n = ast_create(NODE_RAW_STMT); - n->raw_stmt.content = final_code; + char *stmt_code = xmalloc(strlen(final_code) + 2); + sprintf(stmt_code, "%s;", final_code); + free(final_code); + n->raw_stmt.content = stmt_code; return n; } } @@ -3639,7 +3642,10 @@ ASTNode *parse_expr_prec(ParserContext *ctx, Lexer *l, Precedence min_prec) free(inner); ASTNode *n = ast_create(NODE_RAW_STMT); - n->raw_stmt.content = code; + char *stmt_code = xmalloc(strlen(code) + 2); + sprintf(stmt_code, "%s;", code); + free(code); + n->raw_stmt.content = stmt_code; return n; } } |
