pub enum ParseErrorType {
Eof,
ExtraToken(Tok),
InvalidToken,
UnrecognizedToken(Tok, Option<String>),
Lexical(LexicalErrorType),
}
Expand description
Represents the different types of errors that can occur during parsing.
Variants§
Eof
Parser encountered an unexpected end of input
ExtraToken(Tok)
Parser encountered an extra token
InvalidToken
Parser encountered an invalid token
UnrecognizedToken(Tok, Option<String>)
Parser encountered an unexpected token
Lexical(LexicalErrorType)
Parser encountered an error during lexing.
Implementations§
source§impl ParseErrorType
impl ParseErrorType
sourcepub fn is_indentation_error(&self) -> bool
pub fn is_indentation_error(&self) -> bool
Returns true if the error is an indentation error.
sourcepub fn is_tab_error(&self) -> bool
pub fn is_tab_error(&self) -> bool
Returns true if the error is a tab error.
Trait Implementations§
source§impl Debug for ParseErrorType
impl Debug for ParseErrorType
source§impl Display for ParseErrorType
impl Display for ParseErrorType
source§impl Error for ParseErrorType
impl Error for ParseErrorType
1.30.0 · source§fn 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 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl PartialEq for ParseErrorType
impl PartialEq for ParseErrorType
source§fn eq(&self, other: &ParseErrorType) -> bool
fn eq(&self, other: &ParseErrorType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ParseErrorType
Auto Trait Implementations§
impl Freeze for ParseErrorType
impl RefUnwindSafe for ParseErrorType
impl Send for ParseErrorType
impl Sync for ParseErrorType
impl Unpin for ParseErrorType
impl UnwindSafe for ParseErrorType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more