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

@@ -532,11 +532,11 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
stack: &'a mut Stack,
op_dir: &'a OpDir,
output: Outputter,
cell: HeapCellValue,
root_loc: usize,
) -> Self {
HCPrinter {
outputter: output,
iter: stackful_preorder_iter(heap, stack, cell),
iter: stackful_preorder_iter(heap, stack, root_loc),
atom_tbl,
op_dir,
state_stack: vec![],
@@ -1841,6 +1841,8 @@ mod tests {
.heap
.extend(functor!(f_atom, [atom(a_atom), atom(b_atom)]));
wam.machine_st.heap.push(str_loc_as_cell!(0));
{
let printer = HCPrinter::new(
&mut wam.machine_st.heap,
@@ -1848,7 +1850,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
let output = printer.print();
@@ -1870,6 +1872,9 @@ mod tests {
]
));
let h = wam.machine_st.heap.len();
wam.machine_st.heap.push(str_loc_as_cell!(0));
{
let printer = HCPrinter::new(
&mut wam.machine_st.heap,
@@ -1877,7 +1882,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
h,
);
let output = printer.print();
@@ -1901,7 +1906,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
let output = printer.print();
@@ -1914,7 +1919,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
printer
@@ -1947,7 +1952,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
let output = printer.print();
@@ -1966,7 +1971,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
let output = printer.print();
@@ -1983,7 +1988,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
printer
@@ -2015,7 +2020,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
printer.max_depth = 5;
@@ -2031,6 +2036,10 @@ mod tests {
put_partial_string(&mut wam.machine_st.heap, "abc", &wam.machine_st.atom_tbl);
wam.machine_st.heap.push(pstr_loc_as_cell!(0));
let h = wam.machine_st.heap.len() - 1;
{
let printer = HCPrinter::new(
&mut wam.machine_st.heap,
@@ -2038,7 +2047,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
pstr_loc_as_cell!(0),
h,
);
let output = printer.print();
@@ -2048,6 +2057,7 @@ mod tests {
all_cells_unmarked(&wam.machine_st.heap);
wam.machine_st.heap.pop();
wam.machine_st.heap.pop();
wam.machine_st.heap.push(list_loc_as_cell!(2));
@@ -2066,7 +2076,7 @@ mod tests {
&mut wam.machine_st.stack,
&wam.op_dir,
PrinterOutputter::new(),
heap_loc_as_cell!(0),
0,
);
printer.double_quotes = true;