aboutsummaryrefslogtreecommitdiff
path: root/src/generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator.c')
-rw-r--r--src/generator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/generator.c b/src/generator.c
index 3ecfe0d..dc85517 100644
--- a/src/generator.c
+++ b/src/generator.c
@@ -266,7 +266,7 @@ void gen_or(int left, int right, int idx) {
266 fprintf(output, "jmp .false%d\n", idx); 266 fprintf(output, "jmp .false%d\n", idx);
267 fprintf(output, ".true%d:\n", idx); 267 fprintf(output, ".true%d:\n", idx);
268 fprintf(output, "push 1\n"); 268 fprintf(output, "push 1\n");
269 fprintf(output, ".false%d:", idx); 269 fprintf(output, ".false%d:\n", idx);
270} 270}
271 271
272void gen_and(int left, int right, int idx) { 272void gen_and(int left, int right, int idx) {
@@ -284,7 +284,7 @@ void gen_and(int left, int right, int idx) {
284 fprintf(output, "jmp .true%d\n", idx); 284 fprintf(output, "jmp .true%d\n", idx);
285 fprintf(output, ".false%d:\n", idx); 285 fprintf(output, ".false%d:\n", idx);
286 fprintf(output, "push 0\n"); 286 fprintf(output, "push 0\n");
287 fprintf(output, ".true%d:", idx); 287 fprintf(output, ".true%d:\n", idx);
288} 288}
289 289
290void gen_eq(const char op[], int left, int right, int idx) { 290void gen_eq(const char op[], int left, int right, int idx) {
@@ -300,7 +300,7 @@ void gen_eq(const char op[], int left, int right, int idx) {
300 else 300 else
301 exit(1); // TODO: error on unexpected op 301 exit(1); // TODO: error on unexpected op
302 302
303 fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:", idx, idx, 303 fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:\n", idx, idx,
304 idx); 304 idx);
305} 305}
306 306
@@ -321,7 +321,7 @@ void gen_order(const char op[], int left, int right, int idx) {
321 else 321 else
322 exit(1); // TODO: error on unexpected op 322 exit(1); // TODO: error on unexpected op
323 323
324 fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:", idx, idx, 324 fprintf(output, "push 0\njmp .false%d\n.true%d:\npush 1\n.false%d:\n", idx, idx,
325 idx); 325 idx);
326} 326}
327 327