Fix variable lookup
This commit is contained in:
parent
be36d4697d
commit
b1f9e5cefc
@ -101,8 +101,10 @@ impl Evaluator {
|
|||||||
e@StringLiteral(_) => e,
|
e@StringLiteral(_) => e,
|
||||||
e@Number(_) => e,
|
e@Number(_) => e,
|
||||||
Variable(var) => {
|
Variable(var) => {
|
||||||
let expr = self.varmap.lookup_binding(var).unwrap();
|
match self.varmap.lookup_binding(var) {
|
||||||
expr.clone()
|
None => Null,
|
||||||
|
Some(expr) => expr.clone()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
BinExp(op, box left, box right) => {
|
BinExp(op, box left, box right) => {
|
||||||
if right.is_reducible() {
|
if right.is_reducible() {
|
||||||
|
Loading…
Reference in New Issue
Block a user