FIX: lookups on env variables were broken.

This commit is contained in:
Jeremy Wall 2019-01-30 21:34:59 -06:00
parent e3190b724b
commit 8aacd49a77

View File

@ -134,6 +134,13 @@ impl Scope {
}
if self.search_curr_val && self.curr_val.is_some() {
match self.curr_val.as_ref().unwrap().as_ref() {
&Val::Env(ref fs) => {
for (name, val) in fs.iter() {
if name == &sym.val {
return Some(Rc::new(Val::Str(val.clone())));
}
}
}
&Val::Tuple(ref fs) => match Self::lookup_in_tuple(&sym.pos, &sym.val, fs) {
Ok(v) => return Some(v),
Err(_) => {