pub struct GeneratedMatch { /* private fields */ }Expand description
Outcome of a generated token / set / not-set match that may recover.
Generated parsers append children to the current rule context. consumed_eof
reports whether the match actually consumed a real EOF terminal — it is true
only on a successful match (or single-token deletion that lands on EOF), and
always false on single-token insertion, which synthesizes a missing token and
consumes nothing. Generated code feeds this into finish_rule’s
consumed_eof, so the rule stop token is recorded as EOF only when EOF was
truly matched, matching ANTLR’s matchedEOF semantics.
Implementations§
Source§impl GeneratedMatch
impl GeneratedMatch
Sourcepub fn children(&self) -> &[ParseTree]
pub fn children(&self) -> &[ParseTree]
Parse-tree children produced by the match (the matched terminal, an error node plus deleted-then-matched terminal, or a single missing-token error node).
Sourcepub fn into_children(self) -> Vec<ParseTree>
pub fn into_children(self) -> Vec<ParseTree>
Consumes the result, returning the children for appending to the rule context.
Sourcepub const fn consumed_eof(&self) -> bool
pub const fn consumed_eof(&self) -> bool
Whether a real EOF terminal was consumed by this match.
Trait Implementations§
Source§impl Clone for GeneratedMatch
impl Clone for GeneratedMatch
Source§fn clone(&self) -> GeneratedMatch
fn clone(&self) -> GeneratedMatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more