correct chunk type labeling

This commit is contained in:
Mark Thom
2023-01-01 11:04:46 -07:00
committed by Mark
parent 942095baa7
commit cb59c3003a
4 changed files with 91 additions and 24 deletions

View File

@@ -79,8 +79,8 @@ pub enum CallPolicy {
Counted,
}
#[derive(Debug, Clone, Copy)]
enum ChunkType {
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ChunkType {
Head,
Mid,
Last,
@@ -95,6 +95,11 @@ impl ChunkType {
ChunkType::Last => GenContext::Last(chunk_num),
}
}
#[inline(always)]
pub fn is_last(self) -> bool {
self == ChunkType::Last
}
}
#[derive(Debug)]
@@ -104,6 +109,7 @@ pub enum QueryTerm {
Cut,
Not(Vec<QueryTerm>),
IfThen(Vec<QueryTerm>, Vec<QueryTerm>),
LocalCut(Cell<VarReg>), // for IfThen.
Branch(Vec<Vec<QueryTerm>>),
ChunkTypeBoundary(ChunkType),
}