Enum wagon_lexer::LexingError
source · pub enum LexingError {
UnknownError,
UnexpectedCharacter(String, Span),
UnexpectedEOF(Span),
ParseIntError(ParseIntError, Span),
ParseFloatError(ParseFloatError, Span),
}
Expand description
An Enum for any errors that may occur during lexing.
Variants§
UnknownError
Error for any unknown reason. Usually when a character is encountered that can not be lexed.
UnexpectedCharacter(String, Span)
Error for an unexpected character.
UnexpectedEOF(Span)
Error when encountering EOF before we expect.
ParseIntError(ParseIntError, Span)
Error when parsing an int
ParseFloatError(ParseFloatError, Span)
Error when parsing a float
Trait Implementations§
source§impl Clone for LexingError
impl Clone for LexingError
source§fn clone(&self) -> LexingError
fn clone(&self) -> LexingError
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 LexingError
impl Debug for LexingError
source§impl Default for LexingError
impl Default for LexingError
source§fn default() -> LexingError
fn default() -> LexingError
Returns the “default value” for a type. Read more
source§impl Display for LexingError
impl Display for LexingError
source§impl Error for LexingError
impl Error for LexingError
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 LexingError
impl PartialEq for LexingError
source§fn eq(&self, other: &LexingError) -> bool
fn eq(&self, other: &LexingError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'source> ResultNext<Tokens, LexingError> for LexerBridge<'source>
impl<'source> ResultNext<Tokens, LexingError> for LexerBridge<'source>
source§fn next_result(&mut self) -> Result<Tokens, LexingError>
fn next_result(&mut self) -> Result<Tokens, LexingError>
If you have an iterator that holds
Result
items, you start having to deal with nested Some(Ok(...))
patterns,
which gets annoying quickly. This trait is intended so that the iterator always returns some sort of Result
, which can then be unwrapped as needed (probably using ?
). Read moresource§impl<'source> ResultPeek<Tokens, LexingError> for LexerBridge<'source>
impl<'source> ResultPeek<Tokens, LexingError> for LexerBridge<'source>
source§fn peek_result(&mut self) -> Result<&Tokens, LexingError>
fn peek_result(&mut self) -> Result<&Tokens, LexingError>
See
next_result
. Read moresource§impl Spannable for LexingError
impl Spannable for LexingError
impl Eq for LexingError
impl StructuralPartialEq for LexingError
Auto Trait Implementations§
impl Freeze for LexingError
impl RefUnwindSafe for LexingError
impl Send for LexingError
impl Sync for LexingError
impl Unpin for LexingError
impl UnwindSafe for LexingError
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