remove Term

This commit is contained in:
Mark Thom
2024-07-16 15:38:22 -06:00
committed by Mark Thom
parent 34ac85bb6d
commit 1ef681bd21
43 changed files with 3823 additions and 2720 deletions

View File

@@ -11,8 +11,8 @@ use std::vec::IntoIter;
pub(super) type Bindings = Vec<(usize, HeapCellValue)>;
#[derive(Debug)]
pub(super) struct AttrVarInitializer {
pub(super) attr_var_queue: Vec<usize>,
pub(crate) struct AttrVarInitializer {
pub(crate) attr_var_queue: Vec<usize>,
pub(super) bindings: Bindings,
pub(super) p: usize,
pub(super) cp: usize,
@@ -131,9 +131,15 @@ impl MachineState {
pub(super) fn attr_vars_of_term(&mut self, cell: HeapCellValue) -> Vec<HeapCellValue> {
let mut seen_set = IndexSet::new();
let mut seen_vars = vec![];
let root_loc = if cell.is_ref() {
cell.get_value() as usize
} else {
return vec![];
};
let mut iter =
stackful_preorder_iter::<NonListElider>(&mut self.heap, &mut self.stack, cell);
let mut iter = stackful_preorder_iter::<NonListElider>(
&mut self.heap, &mut self.stack, root_loc, // cell,
);
while let Some(value) = iter.next() {
read_heap_cell!(value,