print attribute goals alongside variable bindings as a single, unified goals

This commit is contained in:
Mark Thom
2019-03-24 00:26:29 -06:00
parent 0351936a58
commit 11198fdb31
3 changed files with 32 additions and 20 deletions

View File

@@ -250,13 +250,12 @@ impl Machine {
Ok(())
}
pub fn remove_unbound_vars(&self, heap_locs: &mut HeapVarDict) {
for (var, addr) in heap_locs.clone() {
pub fn remove_unbound_vars(&self, orig_heap_locs: &HeapVarDict, heap_locs: &mut HeapVarDict) {
for (var, addr) in orig_heap_locs.iter() {
match self.machine_st.store(self.machine_st.deref(addr.clone())) {
new_addr =>
if addr.is_ref() && new_addr == addr {
heap_locs.remove(&var);
}
new_addr => if new_addr.is_ref() {
heap_locs.remove(var);
}
}
}
}