Records a cut of the given depth in the innermost frame.
How many open frames currently hold a cut.
Marks the innermost frame's cut as consumed by the current alternative.
Create a span for the given index
Start index (same as Span.begin)
End index (same as Span.end)
Cut depth of the innermost open rule frame (0 if there is none).
True if an enclosing construct has committed (cut) without finishing yet. Resyncs inside such a scope must stay local to it!
Pops the innermost cut frame and returns the depth it reached.
Pushes a fresh cut frame for a rule invocation.
Panic-mode recovery: scan forward for the next index where item
matches, turning all skipped source into a single error node. Returns the
index to continue parsing from. If nothing works, emits an error up to
end of input.
Only used when NOT inside a committed scope. Inside one, the enclosing construct owns resynchronization (seq_sep rescans for its failed child; repeats emit a minimal error), so no bracket guessing is needed.
Local recovery for a sequence with a fail after a cut. Resynchronize to the nearest position where that child matches, keeping the committed prefix intact. Returns the index to continue from, or null if the child never matches (give up and propagate the fail).
The skipped text becomes a BAD node that carries the recovered child in
its recovered field. This keeps the sequence's fixed arity while still
allowing the parse to recover later
Restores a snapshot taken with OpContext.snapshotCuts.
A snapshot of the cut stack's depths, for speculative parses.
The services an operation's
callneeds from the parser: the input, the grammar, the memoizing entry point for sub-parses, error recovery, and the cut bookkeeping. Provided byparseToCST; see there for what each one does.