record names of variables at root in write_term_to_heap
@@ -267,11 +267,15 @@ fn write_term_to_heap(mut self, term: &'a Term) -> TermWriteResult {
continue;
}
}
- &TermRef::AnonVar(Level::Root) | &TermRef::Constant(Level::Root, ..) |
- &TermRef::Var(Level::Root, ..) => {
+ &TermRef::AnonVar(Level::Root) | &TermRef::Constant(Level::Root, ..) => {
let addr = self.term_as_addr(&term, h);
self.machine_st.heap.push(HeapCellValue::Addr(addr));
}
+ &TermRef::Var(Level::Root, _, ref var) => {
+ let addr = self.term_as_addr(&term, h);
+ self.var_dict.insert(var.clone(), Addr::HeapCell(h));
+ self.machine_st.heap.push(HeapCellValue::Addr(addr));
+ }
&TermRef::AnonVar(_) => {
if let Some((arity, site_h)) = self.queue.pop_front() {
if arity > 1 {
