remove Term
This commit is contained in:
@@ -20,11 +20,11 @@ pub struct LoadStatePayload<TS> {
|
||||
pub(super) module_op_exports: ModuleOpExports,
|
||||
pub(super) non_counted_bt_preds: IndexSet<PredicateKey, FxBuildHasher>,
|
||||
pub(super) predicates: PredicateQueue,
|
||||
pub(super) clause_clauses: Vec<(Term, Term)>,
|
||||
pub(super) clause_clauses: Vec<FocusedHeap>,
|
||||
}
|
||||
|
||||
pub trait TermStream: Sized {
|
||||
fn next(&mut self, op_dir: &CompositeOpDir) -> Result<Term, CompilationError>;
|
||||
fn next(&mut self, op_dir: &CompositeOpDir) -> Result<FocusedHeap, CompilationError>;
|
||||
fn eof(&mut self) -> Result<bool, CompilationError>;
|
||||
fn listing_src(&self) -> &ListingSource;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ impl<'a> BootstrappingTermStream<'a> {
|
||||
|
||||
impl<'a> TermStream for BootstrappingTermStream<'a> {
|
||||
#[inline]
|
||||
fn next(&mut self, op_dir: &CompositeOpDir) -> Result<Term, CompilationError> {
|
||||
fn next(&mut self, op_dir: &CompositeOpDir) -> Result<FocusedHeap, CompilationError> {
|
||||
self.parser.reset();
|
||||
self.parser
|
||||
.read_term(op_dir, Tokens::Default)
|
||||
@@ -72,7 +72,7 @@ impl<'a> TermStream for BootstrappingTermStream<'a> {
|
||||
}
|
||||
|
||||
pub struct LiveTermStream {
|
||||
pub(super) term_queue: VecDeque<Term>,
|
||||
pub(super) term_queue: VecDeque<FocusedHeap>,
|
||||
pub(super) listing_src: ListingSource,
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ impl<TS> LoadStatePayload<TS> {
|
||||
|
||||
impl TermStream for LiveTermStream {
|
||||
#[inline]
|
||||
fn next(&mut self, _: &CompositeOpDir) -> Result<Term, CompilationError> {
|
||||
fn next(&mut self, _: &CompositeOpDir) -> Result<FocusedHeap, CompilationError> {
|
||||
Ok(self.term_queue.pop_front().unwrap())
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ impl TermStream for LiveTermStream {
|
||||
pub struct InlineTermStream {}
|
||||
|
||||
impl TermStream for InlineTermStream {
|
||||
fn next(&mut self, _: &CompositeOpDir) -> Result<Term, CompilationError> {
|
||||
Err(CompilationError::from(ParserError::unexpected_eof()))
|
||||
fn next(&mut self, _: &CompositeOpDir) -> Result<FocusedHeap, CompilationError> {
|
||||
Err(CompilationError::from(ParserError::unexpected_eof(ParserErrorSrc::default())))
|
||||
}
|
||||
|
||||
fn eof(&mut self) -> Result<bool, CompilationError> {
|
||||
|
||||
Reference in New Issue
Block a user