Fix lookup_binding in function call case
This commit is contained in:
parent
5eba222679
commit
c36bc3377e
@ -52,8 +52,6 @@ impl Evaluator {
|
||||
}
|
||||
|
||||
fn lookup_binding(&mut self, var: String) -> Option<Expression> {
|
||||
self.varmap.map.get(&var).map(|expr| expr.clone())
|
||||
.or_else(|| {
|
||||
for frame in self.frames.iter() {
|
||||
match frame.map.get(&var) {
|
||||
None => (),
|
||||
@ -61,8 +59,7 @@ impl Evaluator {
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
})
|
||||
self.varmap.map.get(&var).map(|expr| expr.clone())
|
||||
}
|
||||
|
||||
fn add_function(&mut self, name: String, function: Function) {
|
||||
|
Loading…
Reference in New Issue
Block a user