fix infix emit

This commit is contained in:
zongor 2026-04-09 23:13:25 +00:00
parent 8e430a9d46
commit 11158ba4f9
2 changed files with 8 additions and 3 deletions

View File

@ -234,7 +234,7 @@ c_emit_const()
void void
c_emit_print() c_emit_print()
{ {
printf("printf(\"%%s\", "); printf("putchar");
} }
void void

View File

@ -220,9 +220,14 @@ declaration()
} }
static void print_statement() { static void print_statement() {
if (emitter.notation == INFIX) {
emitter.emit_print();
}
expression(); expression();
consume(TOKEN_SEMICOLON); consume(TOKEN_SEMICOLON);
emitter.emit_print(); if (emitter.notation == POSTFIX) {
emitter.emit_print();
}
} }
static void static void