#[non_exhaustive]pub enum LexError {
UnexpectedInput(String),
UnterminatedString,
StringTooLong(usize),
MalformedEscapeSequence(String),
MalformedNumber(String),
MalformedChar(String),
MalformedIdentifier(String),
ImproperSymbol(String, String),
Runtime(String),
}
Expand description
Error encountered when tokenizing the script text.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnexpectedInput(String)
An unexpected symbol is encountered.
UnterminatedString
A string literal is not terminated before a new-line or EOF.
StringTooLong(usize)
An identifier or string literal is longer than the maximum allowed length.
MalformedEscapeSequence(String)
An string/character/numeric escape sequence is in an invalid format.
MalformedNumber(String)
An numeric literal is in an invalid format.
MalformedChar(String)
An character literal is in an invalid format.
MalformedIdentifier(String)
An identifier is in an invalid format.
ImproperSymbol(String, String)
Bad symbol encountered.
Runtime(String)
Runtime error occurred.
Implementations§
source§impl LexError
impl LexError
sourcepub fn into_err(self, pos: Position) -> ParseError
pub fn into_err(self, pos: Position) -> ParseError
Convert a LexError
into a ParseError
.
Trait Implementations§
source§impl Error for LexError
impl Error for LexError
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 From<LexError> for ParseErrorType
impl From<LexError> for ParseErrorType
source§impl PartialEq for LexError
impl PartialEq for LexError
impl Eq for LexError
impl StructuralPartialEq for LexError
Auto Trait Implementations§
impl Freeze for LexError
impl RefUnwindSafe for LexError
impl Send for LexError
impl Sync for LexError
impl Unpin for LexError
impl UnwindSafe for LexError
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
source§impl<T> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.