record names of variables at root in write_term_to_heap (#487)
This commit is contained in:
@@ -267,11 +267,15 @@ impl<'a> TermWriter<'a> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&TermRef::AnonVar(Level::Root) | &TermRef::Constant(Level::Root, ..) |
|
&TermRef::AnonVar(Level::Root) | &TermRef::Constant(Level::Root, ..) => {
|
||||||
&TermRef::Var(Level::Root, ..) => {
|
|
||||||
let addr = self.term_as_addr(&term, h);
|
let addr = self.term_as_addr(&term, h);
|
||||||
self.machine_st.heap.push(HeapCellValue::Addr(addr));
|
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(_) => {
|
&TermRef::AnonVar(_) => {
|
||||||
if let Some((arity, site_h)) = self.queue.pop_front() {
|
if let Some((arity, site_h)) = self.queue.pop_front() {
|
||||||
if arity > 1 {
|
if arity > 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user