pub enum Instr {
Show 15 variants
MatchPredicate(usize),
MatchStructure(usize),
Split {
a: usize,
b: usize,
},
Jump(usize),
PushAxis(Axis),
Pop,
Save,
Accept,
Search {
pat_idx: usize,
capture_map: Vec<(String, usize)>,
},
ExtendSequence,
CombineSequence,
NotMatch {
pat_idx: usize,
},
Repeat {
pat_idx: usize,
quantifier: Quantifier,
},
CaptureStart(usize),
CaptureEnd(usize),
}Expand description
Bytecode instructions for the pattern VM.
Variants§
MatchPredicate(usize)
Match predicate: literals[idx].matches(cbor)
MatchStructure(usize)
Match structure: use literals[idx].paths(cbor) for structure patterns
Split
ε-split: fork execution to a and b
Jump(usize)
Unconditional jump to instruction at index
PushAxis(Axis)
Descend to children via axis, one thread per child
Pop
Pop one CBOR value from the path
Save
Emit current path
Accept
Final accept, emit current path and halt thread
Search
Recursively search for pattern at pat_idx and propagate captures
ExtendSequence
Save current path and start new sequence from last CBOR value
CombineSequence
Combine saved path with current path for final result
NotMatch
Match only if pattern at pat_idx does not match
Repeat
Repeat a sub pattern according to range and greediness
CaptureStart(usize)
Mark the start of a capture group
CaptureEnd(usize)
Mark the end of a capture group
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Instr
impl RefUnwindSafe for Instr
impl Send for Instr
impl Sync for Instr
impl Unpin for Instr
impl UnwindSafe for Instr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more