diff --git a/src/interpret/linux_x86_64.rs b/src/interpret/linux_x86_64.rs index d5ac5bb..f25a6dc 100644 --- a/src/interpret/linux_x86_64.rs +++ b/src/interpret/linux_x86_64.rs @@ -42,14 +42,14 @@ pub fn run(tokens: Vec) -> Result<(), &'static str>{ ti += 1; }, OpType::Gt => { - let a = stack_pop(&mut stack)?; let b = stack_pop(&mut stack)?; + let a = stack_pop(&mut stack)?; stack.push((a > b) as i32); ti += 1; }, OpType::Lt => { - let a = stack_pop(&mut stack)?; let b = stack_pop(&mut stack)?; + let a = stack_pop(&mut stack)?; stack.push((a < b) as i32); ti += 1; }, diff --git a/test.mcl b/test.mcl index ac1e00b..ab3029f 100644 --- a/test.mcl +++ b/test.mcl @@ -1,4 +1,4 @@ -1 2 < if +2 1 < if 1 print else 0 print