#[non_exhaustive]pub enum MatchError {
ProseValueReachable {
rule: String,
prose: String,
},
UnrepresentableTerminal {
rule: String,
terminal: String,
},
UnknownRule(String),
LeftRecursionDetected {
rule: String,
},
StepLimit,
DepthLimit,
}Expand description
Recognition could not be attempted, or could not be finished.
Never returned to mean “the input does not match” — that is Ok(false).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ProseValueReachable
The start rule can reach a prose value, which has no matching semantics (SCOPE.md 6.5).
UnrepresentableTerminal
The start rule can reach a terminal that no Unicode scalar value can match (SCOPE.md 6.1).
UnknownRule(String)
No such rule in the grammar or the core environment.
LeftRecursionDetected
The in-progress guard fired. Unreachable after check, which rejects left recursion
outright; kept as belt and braces (SCOPE.md 6.2).
StepLimit
MatchOptions::max_steps was exceeded. Never a silent reject (D16).
DepthLimit
MatchOptions::max_depth was exceeded.
The recognizer descends recursively, so nesting in the input becomes depth on the call stack. Without this limit a deeply nested input overflows the stack, and a stack overflow aborts the process — it cannot be caught and reported as “could not decide”, which is what every other limit here does.
Trait Implementations§
Source§impl Clone for MatchError
impl Clone for MatchError
Source§impl Debug for MatchError
impl Debug for MatchError
Source§impl Display for MatchError
impl Display for MatchError
impl Eq for MatchError
Source§impl Error for MatchError
impl Error for MatchError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()