Fixed unary minus
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ fn get_value(v: Value, scopes: &mut [Scope]) -> Result<TeaValue, InterpreterErro
|
||||
match v {
|
||||
Value::Lit(t) => Ok(t),
|
||||
Value::Id(s) => {
|
||||
match scopes.iter().rev().skip_while(|scope| !scope.contains_key(&s)).next() {
|
||||
match scopes.iter().rev().find(|scope| scope.contains_key(&s)) {
|
||||
None => Err(InterpreterError::new("undefined variable")),
|
||||
Some(scope) => match scope.get(&s).unwrap() {
|
||||
VarType::Const(t) => Ok(t.clone()),
|
||||
|
||||
Reference in New Issue
Block a user