diff --git a/src/ast.rs b/src/ast.rs index 5cc83c1..7c0fdcf 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -323,7 +323,7 @@ impl Node for Expression { } let stack_position = state.variables.len() - - state.variables.iter().position(|x| x == name).unwrap() + - state.variables.iter().rposition(|x| x == name).unwrap() - 1; dbg!(&state.variables);