diff --git a/source/compiler/codegen/expression/precedence.ts b/source/compiler/codegen/expression/precedence.ts index b7ceb0d..b10ebe3 100644 --- a/source/compiler/codegen/expression/precedence.ts +++ b/source/compiler/codegen/expression/precedence.ts @@ -63,15 +63,15 @@ export function ApplyPrecedence(syntax: Term_Expr) { // (1 + 2) * 3 -> (2 * 3) + 1 root = { type: "infix", - lhs: { + lhs: root.lhs, + op: root.op, + rhs: { type: "infix", lhs: root.rhs, op, rhs: arg, ref: ReferenceRange.union(root.ref, arg.ref) }, - op: root.op, - rhs: root.lhs, ref: ReferenceRange.union(arg.ref, arg.ref) } } else {