Skip to main content

parse_fast

Function parse_fast 

Source
pub fn parse_fast<'a, T: ParserTrait + 'static>(
    root: T,
    text: &'a str,
) -> Option<(Parse, Vec<FatToken<T::Kind>>)>
where T::Kind: Logos<'a, Source = str>, <<T as ParserTrait>::Kind as Logos<'a>>::Extras: Default,
Expand description

Parses text in non-fault-tolerant fast mode.

Returns Some((parse, tokens)) when the document is error-free, or None if any token could not be matched. Use this when you know the document is correct and want maximum throughput — no error-recovery branches are explored, no prevInfo fingerprints are tracked, and no heuristic is precomputed.