pub enum ParseError {
Expected {
expected: Box<[TokenKind]>,
found: Token,
context: &'static str,
},
Unexpected {
found: Token,
message: Option<&'static str>,
},
AbruptEnd,
Lex {
err: Error,
},
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
A lexing error.
General
Catch all General Error
Unimplemented
Unimplemented syntax error
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl From<Error> for ParseError
impl From<Error> for ParseError
Source§fn from(e: LexError) -> ParseError
fn from(e: LexError) -> ParseError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParseError
impl !RefUnwindSafe for ParseError
impl !Send for ParseError
impl !Sync for ParseError
impl Unpin for ParseError
impl !UnwindSafe for ParseError
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