pub enum ParseError {
Expected {
expected: Box<[TokenKind]>,
found: Token,
context: &'static str,
},
Unexpected {
found: Token,
message: Option<&'static str>,
},
AbruptEnd,
Lex {
err: LexError,
},
General {
message: &'static str,
position: Position,
},
Unimplemented {
message: &'static str,
position: Position,
},
}
Expand description
ParseError
is an enum which represents errors encounted during parsing an expression
Variants
Expected
When it expected a certain kind of token, but got another as part of something
Unexpected
When a token is unexpected
AbruptEnd
When there is an abrupt end to the parsing
Lex
Fields
err: LexError
A lexing error.
General
Catch all General Error
Unimplemented
Unimplemented syntax error
Trait Implementations
sourceimpl Debug for ParseError
impl Debug for ParseError
sourceimpl Display for ParseError
impl Display for ParseError
sourceimpl From<Error> for ParseError
impl From<Error> for ParseError
sourcefn from(e: LexError) -> ParseError
fn from(e: LexError) -> ParseError
Converts to this type from the input type.
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