Fix variable lookup

This commit is contained in:
greg 2016-01-22 02:59:33 -08:00
parent be36d4697d
commit b1f9e5cefc
1 changed files with 4 additions and 2 deletions

View File

@ -101,8 +101,10 @@ impl Evaluator {
e@StringLiteral(_) => e,
e@Number(_) => e,
Variable(var) => {
let expr = self.varmap.lookup_binding(var).unwrap();
expr.clone()
match self.varmap.lookup_binding(var) {
None => Null,
Some(expr) => expr.clone()
}
},
BinExp(op, box left, box right) => {
if right.is_reducible() {