From 282a0b86ba31c2b9e3db0a0b4b3b9e3c062e1e81 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Thu, 7 Jan 2021 18:11:21 -0300 Subject: [PATCH] Fix operation order --- compiler/compiler-expressions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/compiler-expressions.c b/compiler/compiler-expressions.c index 5e517f0..d6c5f66 100644 --- a/compiler/compiler-expressions.c +++ b/compiler/compiler-expressions.c @@ -204,15 +204,18 @@ LINEBLOCK* compileterm(SCOPE* s, DEBUGINFO* d, TERM* t) { // Dealing with whole expressions LINEBLOCK* compileexpression(SCOPE* s, DEBUGINFO* d, TERM* e) { LINEBLOCK* blk = NULL; + LINEBLOCK* ops = NULL; if(e != NULL) { while(true) { blk = mergelnblks(blk, compileterm(s, d, e)); if(e->next == NULL) break; - appendln(blk, mathopln(e->op)); + ops = mergelnblks(ops, mklnblk(mathopln(e->op))); e = e->next; } } + if(ops != NULL) + blk = mergelnblks(blk, ops); return blk; }