Skip to main content

parse_fold

Function parse_fold 

pub fn parse_fold(
    job: ParseJob<'_, '_>,
    sink: &mut dyn FoldSink,
) -> Result<(), ParseError>
Expand description

Monomorphic reduce-time fold: drive the same lexer/feed loop as parse_with but under [Reduce::Fold], forwarding every shift/reduce to sink (which owns its own typed value stack). No tree and no Foreign(Arc) box is built — the Rust-native peer to a transformer= hook, without the per-reduction heap box. Returns Ok(()) on accept (the root value is left on the sink); the same ParseError on reject.