Fix unm-instruction
This commit is contained in:
parent
d04ddd95d0
commit
f3870e2e1a
@ -21,4 +21,4 @@ print(add(10)(15))
|
||||
print(add(10)(15))
|
||||
print(b)
|
||||
print(min(11, 9))
|
||||
print(10 > 5 or 11 < 10)
|
||||
print(10 - 15)
|
||||
@ -351,9 +351,8 @@ impl Expression {
|
||||
));
|
||||
}
|
||||
BinaryOperator::Sub => {
|
||||
let temp = scope.register_counter.next();
|
||||
instructions.push(Instruction::Unm(temp, *rhs.get(0).unwrap()));
|
||||
instructions.push(Instruction::Add(reg, *lhs.get(0).unwrap(), temp));
|
||||
instructions.push(Instruction::Unm(reg, *rhs.get(0).unwrap()));
|
||||
instructions.push(Instruction::Add(reg, *lhs.get(0).unwrap(), reg));
|
||||
}
|
||||
BinaryOperator::And => {
|
||||
instructions.push(Instruction::And(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user