pub struct GeneratedParseOutput<R, P> {
pub result: R,
pub parser: P,
}Expand description
Result from a generated parse_with_parser or parse_stream_with_parser
call.
Keeps the generated parser available after the entry rule runs so callers
can inspect diagnostics or recover the parser-owned token stream. Generated
modules alias this type as <Grammar>ParserParseOutput<R, L> with their
parser type substituted for P; Self::validate is available for those
generated parser types, which wire in their module’s validated surface.
Fields§
§result: RValue returned by the caller-selected entry rule.
parser: PThe generated parser after the entry rule has run.
Implementations§
Source§impl<P: __GeneratedParserValidate> GeneratedParseOutput<NodeId, P>
impl<P: __GeneratedParserValidate> GeneratedParseOutput<NodeId, P>
Sourcepub fn validate(self) -> Result<P::Validated, ValidationError>
pub fn validate(self) -> Result<P::Validated, ValidationError>
Validates a completed parse and changes its generated context surface.
Validation rejects lexer diagnostics, parser recovery, recovered error nodes, and missing generated required children before constructing the validated-tree type boundary.
§Errors
Returns a ValidationError when the parse recorded lexer or parser
syntax errors or the completed tree fails structural validation.