introduce InlineTermStream to avoid arena allocations during call_inline (#1576)

This commit is contained in:
Mark Thom
2022-11-08 23:55:22 +01:00
parent d91ee5b77c
commit 9366a48d6d
3 changed files with 84 additions and 14 deletions

View File

@@ -119,3 +119,21 @@ impl TermStream for LiveTermStream {
&self.listing_src
}
}
pub struct InlineTermStream {
}
impl TermStream for InlineTermStream {
fn next(&mut self, _: &CompositeOpDir) -> Result<Term, CompilationError> {
Err(CompilationError::from(ParserError::UnexpectedEOF))
}
fn eof(&mut self) -> Result<bool, CompilationError> {
Ok(true)
}
fn listing_src(&self) -> &ListingSource {
&ListingSource::User
}
}