fixed lt and gt
This commit is contained in:
parent
b6bbb2d251
commit
f9b1184f18
|
@ -42,14 +42,14 @@ pub fn run(tokens: Vec<crate::constants::Operator>) -> Result<(), &'static str>{
|
||||||
ti += 1;
|
ti += 1;
|
||||||
},
|
},
|
||||||
OpType::Gt => {
|
OpType::Gt => {
|
||||||
let a = stack_pop(&mut stack)?;
|
|
||||||
let b = stack_pop(&mut stack)?;
|
let b = stack_pop(&mut stack)?;
|
||||||
|
let a = stack_pop(&mut stack)?;
|
||||||
stack.push((a > b) as i32);
|
stack.push((a > b) as i32);
|
||||||
ti += 1;
|
ti += 1;
|
||||||
},
|
},
|
||||||
OpType::Lt => {
|
OpType::Lt => {
|
||||||
let a = stack_pop(&mut stack)?;
|
|
||||||
let b = stack_pop(&mut stack)?;
|
let b = stack_pop(&mut stack)?;
|
||||||
|
let a = stack_pop(&mut stack)?;
|
||||||
stack.push((a < b) as i32);
|
stack.push((a < b) as i32);
|
||||||
ti += 1;
|
ti += 1;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user