Revert "remove Term"

This reverts commit 3b5879841aedecba5057c70c71da0ba23e5cd84a.
This commit is contained in:
Mark Thom
2025-03-15 13:19:26 -07:00
committed by Mark Thom
parent eef7b06919
commit 9e1e99f961
53 changed files with 3726 additions and 4517 deletions

View File

@@ -2,9 +2,10 @@ use crate::parser::ast::*;
use crate::forms::*;
use crate::instructions::*;
use crate::machine::heap::Heap;
use crate::targets::*;
use std::cell::Cell;
pub(crate) trait Allocator {
fn new() -> Self;
@@ -18,21 +19,22 @@ pub(crate) trait Allocator {
fn mark_non_var<'a, Target: CompilationTarget<'a>>(
&mut self,
lvl: Level,
heap_loc: usize,
context: GenContext,
cell: &'a Cell<RegType>,
code: &mut CodeDeque,
) -> RegType;
);
#[allow(clippy::too_many_arguments)]
fn mark_reserved_var<'a, Target: CompilationTarget<'a>>(
&mut self,
var_num: usize,
lvl: Level,
context: GenContext,
cell: &Cell<VarReg>,
term_loc: GenContext,
code: &mut CodeDeque,
r: RegType,
is_new_var: bool,
) -> RegType;
);
fn mark_cut_var(&mut self, var_num: usize, chunk_num: usize) -> RegType;
@@ -40,13 +42,14 @@ pub(crate) trait Allocator {
&mut self,
var_num: usize,
lvl: Level,
cell: &Cell<VarReg>,
context: GenContext,
code: &mut CodeDeque,
) -> RegType;
);
fn reset(&mut self);
fn reset_arg(&mut self, arg_num: usize);
fn reset_at_head(&mut self, heap: &mut Heap, head_loc: usize);
fn reset_at_head(&mut self, args: &[Term]);
fn reset_contents(&mut self);
fn advance_arg(&mut self);