Fix or and and operators

This commit is contained in:
Sofia 2026-03-17 21:11:17 +02:00
parent f6548019e3
commit e259bae865
2 changed files with 3 additions and 3 deletions

View File

@ -27,4 +27,4 @@ print(b)
print(min(11, 9)) print(min(11, 9))
print(10 - 15) print(10 - 15)
print("hello there!") print("hello there!")
print(nil or 0) print(true or 0)

View File

@ -484,15 +484,15 @@ impl Expression {
BinaryOperator::And => { BinaryOperator::And => {
instructions.push(Instruction::And( instructions.push(Instruction::And(
reg, reg,
*rhs.get(0).unwrap(),
*lhs.get(0).unwrap(), *lhs.get(0).unwrap(),
*rhs.get(0).unwrap(),
)); ));
} }
BinaryOperator::Or => { BinaryOperator::Or => {
instructions.push(Instruction::Or( instructions.push(Instruction::Or(
reg, reg,
*rhs.get(0).unwrap(),
*lhs.get(0).unwrap(), *lhs.get(0).unwrap(),
*rhs.get(0).unwrap(),
)); ));
} }
}; };