Enum rnix::parser::ParseError
source · #[non_exhaustive]
pub enum ParseError {
Unexpected(TextRange),
UnexpectedExtra(TextRange),
UnexpectedWanted(SyntaxKind, TextRange, Box<[SyntaxKind]>),
UnexpectedDoubleBind(TextRange),
UnexpectedEOF,
UnexpectedEOFWanted(Box<[SyntaxKind]>),
DuplicatedArgs(TextRange, String),
RecursionLimitExceeded,
}
Expand description
An error that occurred during parsing
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unexpected(TextRange)
Unexpected is used when the cause cannot be specified further
UnexpectedExtra(TextRange)
UnexpectedExtra is used when there are additional tokens to the root in the tree
UnexpectedWanted(SyntaxKind, TextRange, Box<[SyntaxKind]>)
UnexpectedWanted is used when specific tokens are expected, but different one is found
UnexpectedDoubleBind(TextRange)
UnexpectedDoubleBind is used when a pattern is bound twice
UnexpectedEOF
UnexpectedEOF is used when the end of file is reached, while tokens are still expected
UnexpectedEOFWanted(Box<[SyntaxKind]>)
UnexpectedEOFWanted is used when specific tokens are expected, but the end of file is reached
DuplicatedArgs(TextRange, String)
DuplicatedArgs is used when formal arguments are duplicated, e.g. { a, a }
RecursionLimitExceeded
RecursionLimitExceeded is used when we’re unable to parse further due to likely being close to a stack overflow.
Trait Implementations
sourceimpl Clone for ParseError
impl Clone for ParseError
sourcefn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ParseError
impl Debug for ParseError
sourceimpl Display for ParseError
impl Display for ParseError
sourceimpl Error for ParseError
impl Error for ParseError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
sourceimpl PartialEq<ParseError> for ParseError
impl PartialEq<ParseError> for ParseError
sourcefn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
impl StructuralPartialEq for ParseError
Auto Trait Implementations
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more