pub enum ParseError {
EmptyExpression,
ExpectedAtom {
position: usize,
},
UnexpectedOperator {
op: char,
position: usize,
},
UnexpectedChar {
ch: char,
position: usize,
},
UnmatchedOpenParen {
position: usize,
},
UnmatchedCloseParen {
position: usize,
},
}Expand description
A parse failure produced by crate::parser::parse.
Variants describe shape-level problems only: the empty input, unmatched parens, operators in disallowed positions, and trailing characters after a complete expression. Atom-content validation (identifier rules, path-pattern grammar, relational kind) is the consumer crate’s responsibility.
Variants§
EmptyExpression
The input contained no atoms after trimming whitespace.
ExpectedAtom
An atom was expected at the given byte offset but the next character was an operator or end-of-input.
UnexpectedOperator
An operator appeared in a position the grammar does not permit (for example, as the leading character of an expression, or immediately after another binary operator).
UnexpectedChar
Unconsumed input remained after a complete expression was parsed (typically a missing operator between two atoms).
UnmatchedOpenParen
An opening parenthesis was never matched by a closing one.
UnmatchedCloseParen
A closing parenthesis appeared with no matching opener.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
impl Eq for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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()
Source§impl ErrorCompat for ParseError
impl ErrorCompat for ParseError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read moreSource§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
self and other values to be equal, and is used by ==.