pub enum Error<'source> {
Lexer(Error<'source>),
MissingToken {
expected: &'static [Lexigram],
actual: Option<Token<'source>>,
},
ExpectedExpression(Option<Token<'source>>),
ExpectedStatementOrExpression(Token<'source>),
UnexpectedCloseParen(Token<'source>),
IncompleteExpression,
}Variants§
Lexer(Error<'source>)
An invalid token was encountered.
The ast interprets an erroneous token as None,
which may lead to further error diagnostics.
See: espy_eyes::Error
MissingToken
Fields
ExpectedExpression(Option<Token<'source>>)
Occurs when an expression is required, but a token that ends expression context was immediately encountered.
ExpectedStatementOrExpression(Token<'source>)
Occurs when a “root” Block encounters something which is not a statement or expression.
UnexpectedCloseParen(Token<'source>)
Occurs when parenthesis in an expression are unbalanced.
Error::IncompleteExpression serves as the opening-parenthesis equivalent.
IncompleteExpression
This error should only ever occur on Expressions,
so positioning can be derived from surrounding context.
Trait Implementations§
impl<'source> Eq for Error<'source>
impl<'source> StructuralPartialEq for Error<'source>
Auto Trait Implementations§
impl<'source> Freeze for Error<'source>
impl<'source> RefUnwindSafe for Error<'source>
impl<'source> Send for Error<'source>
impl<'source> Sync for Error<'source>
impl<'source> Unpin for Error<'source>
impl<'source> UnwindSafe for Error<'source>
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