diff options
Diffstat (limited to 'src/generator.c')
-rw-r--r-- | src/generator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/generator.c b/src/generator.c index c6140f1..ab3777c 100644 --- a/src/generator.c +++ b/src/generator.c | |||
@@ -282,7 +282,7 @@ void gen_or(int left, int right, int idx) { | |||
282 | fprintf(output, "jmp .false%d\n", idx); | 282 | fprintf(output, "jmp .false%d\n", idx); |
283 | fprintf(output, ".true%d:\n", idx); | 283 | fprintf(output, ".true%d:\n", idx); |
284 | fprintf(output, "push 1\n"); | 284 | fprintf(output, "push 1\n"); |
285 | fprintf(output, ".false%d:", idx); | 285 | fprintf(output, ".false%d:\n", idx); |
286 | } | 286 | } |
287 | 287 | ||
288 | void gen_and(int left, int right, int idx) { | 288 | void gen_and(int left, int right, int idx) { |
@@ -300,7 +300,7 @@ void gen_and(int left, int right, int idx) { | |||
300 | fprintf(output, "jmp .true%d\n", idx); | 300 | fprintf(output, "jmp .true%d\n", idx); |
301 | fprintf(output, ".false%d:\n", idx); | 301 | fprintf(output, ".false%d:\n", idx); |
302 | fprintf(output, "push 0\n"); | 302 | fprintf(output, "push 0\n"); |
303 | fprintf(output, ".true%d:", idx); | 303 | fprintf(output, ".true%d:\n", idx); |
304 | } | 304 | } |
305 | 305 | ||
306 | void gen_eq(const char op[], int left, int right, int idx) { | 306 | void gen_eq(const char op[], int left, int right, int idx) { |
@@ -316,7 +316,7 @@ void gen_eq(const char op[], int left, int right, int idx) { | |||
316 | else | 316 | else |
317 | exit(1); // TODO: error on unexpected op | 317 | exit(1); // TODO: error on unexpected op |
318 | 318 | ||
319 | fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:", idx, idx, | 319 | fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:\n", idx, idx, |
320 | idx); | 320 | idx); |
321 | } | 321 | } |
322 | 322 | ||
@@ -337,7 +337,7 @@ void gen_order(const char op[], int left, int right, int idx) { | |||
337 | else | 337 | else |
338 | exit(1); // TODO: error on unexpected op | 338 | exit(1); // TODO: error on unexpected op |
339 | 339 | ||
340 | fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:", idx, idx, | 340 | fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:\n", idx, idx, |
341 | idx); | 341 | idx); |
342 | } | 342 | } |
343 | 343 | ||