From e259bae86553dd2c62fd7dcd335768756e97d725 Mon Sep 17 00:00:00 2001 From: Sofia Date: Tue, 17 Mar 2026 21:11:17 +0200 Subject: [PATCH] Fix or and and operators --- examples/test.lua | 2 +- src/compile.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/test.lua b/examples/test.lua index ebaa6be..9c0e831 100644 --- a/examples/test.lua +++ b/examples/test.lua @@ -27,4 +27,4 @@ print(b) print(min(11, 9)) print(10 - 15) print("hello there!") -print(nil or 0) \ No newline at end of file +print(true or 0) \ No newline at end of file diff --git a/src/compile.rs b/src/compile.rs index 7231ec8..4d19e58 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -484,15 +484,15 @@ impl Expression { BinaryOperator::And => { instructions.push(Instruction::And( reg, - *rhs.get(0).unwrap(), *lhs.get(0).unwrap(), + *rhs.get(0).unwrap(), )); } BinaryOperator::Or => { instructions.push(Instruction::Or( reg, - *rhs.get(0).unwrap(), *lhs.get(0).unwrap(), + *rhs.get(0).unwrap(), )); } };