Get cart assignments working
This commit is contained in:
parent
5db6eebdc0
commit
5634a8ad2b
|
@ -255,14 +255,20 @@ impl ExecEnv {
|
||||||
for index in indices {
|
for index in indices {
|
||||||
let index = self.eval_expr(index)?;
|
let index = self.eval_expr(index)?;
|
||||||
|
|
||||||
let value = cell.borrow().to_owned();
|
let next_cell;
|
||||||
let mut value = value.into_cart();
|
match &mut *cell.borrow_mut() {
|
||||||
if let Some(x) = value.get(&index) {
|
Value::Cart(c) => {
|
||||||
cell = Rc::clone(x);
|
if let Some(x) = c.get(&index) {
|
||||||
} else {
|
next_cell = Rc::clone(x);
|
||||||
cell = Rc::new(RefCell::new(Value::Cart(Default::default())));
|
} else {
|
||||||
value.insert(index, Rc::clone(&cell));
|
next_cell =
|
||||||
|
Rc::new(RefCell::new(Value::Cart(Default::default())));
|
||||||
|
c.insert(index, Rc::clone(&next_cell));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => todo!(),
|
||||||
}
|
}
|
||||||
|
cell = next_cell;
|
||||||
}
|
}
|
||||||
cell.replace(value);
|
cell.replace(value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue