Fix operation order
This commit is contained in:
parent
e36d47a899
commit
282a0b86ba
|
@ -204,15 +204,18 @@ LINEBLOCK* compileterm(SCOPE* s, DEBUGINFO* d, TERM* t) {
|
||||||
// Dealing with whole expressions
|
// Dealing with whole expressions
|
||||||
LINEBLOCK* compileexpression(SCOPE* s, DEBUGINFO* d, TERM* e) {
|
LINEBLOCK* compileexpression(SCOPE* s, DEBUGINFO* d, TERM* e) {
|
||||||
LINEBLOCK* blk = NULL;
|
LINEBLOCK* blk = NULL;
|
||||||
|
LINEBLOCK* ops = NULL;
|
||||||
if(e != NULL) {
|
if(e != NULL) {
|
||||||
while(true) {
|
while(true) {
|
||||||
blk = mergelnblks(blk, compileterm(s, d, e));
|
blk = mergelnblks(blk, compileterm(s, d, e));
|
||||||
if(e->next == NULL)
|
if(e->next == NULL)
|
||||||
break;
|
break;
|
||||||
appendln(blk, mathopln(e->op));
|
ops = mergelnblks(ops, mklnblk(mathopln(e->op)));
|
||||||
e = e->next;
|
e = e->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ops != NULL)
|
||||||
|
blk = mergelnblks(blk, ops);
|
||||||
return blk;
|
return blk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue