pub enum ParserError {
UnexpectedToken {
token: String,
position: Position,
expected: Option<String>,
},
UnexpectedEndOfInput {
position: Position,
expected: Option<String>,
},
InvalidSyntax {
message: String,
position: Position,
},
InvalidExpression {
message: String,
position: Position,
},
InvalidStatement {
message: String,
position: Position,
},
InvalidDeclaration {
message: String,
position: Position,
},
InvalidFunction {
message: String,
position: Position,
},
InvalidClass {
message: String,
position: Position,
},
InvalidModule {
message: String,
position: Position,
},
LexerError {
message: String,
position: Position,
},
InternalError {
message: String,
},
}Variants§
UnexpectedToken
UnexpectedEndOfInput
InvalidSyntax
InvalidExpression
InvalidStatement
InvalidDeclaration
InvalidFunction
InvalidClass
InvalidModule
LexerError
InternalError
Implementations§
Source§impl ParserError
impl ParserError
pub fn unexpected_token(token: &Token, expected: Option<&str>) -> Self
pub fn unexpected_end_of_input(expected: Option<&str>) -> Self
pub fn invalid_syntax(message: &str, position: Position) -> Self
pub fn invalid_expression(message: &str, position: Position) -> Self
pub fn invalid_statement(message: &str, position: Position) -> Self
pub fn invalid_declaration(message: &str, position: Position) -> Self
pub fn invalid_function(message: &str, position: Position) -> Self
pub fn invalid_class(message: &str, position: Position) -> Self
pub fn invalid_module(message: &str, position: Position) -> Self
pub fn lexer_error(message: &str, position: Position) -> Self
pub fn internal_error(message: &str) -> Self
pub fn position(&self) -> Option<Position>
pub fn span(&self) -> Option<Span>
Trait Implementations§
Source§impl Clone for ParserError
impl Clone for ParserError
Source§fn clone(&self) -> ParserError
fn clone(&self) -> ParserError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParserError
impl Debug for ParserError
Source§impl Display for ParserError
impl Display for ParserError
Source§impl Error for ParserError
impl Error for ParserError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 ParserError
impl PartialEq for ParserError
impl StructuralPartialEq for ParserError
Auto Trait Implementations§
impl Freeze for ParserError
impl RefUnwindSafe for ParserError
impl Send for ParserError
impl Sync for ParserError
impl Unpin for ParserError
impl UnwindSafe for ParserError
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