#[non_exhaustive]
pub enum LexError {
UnexpectedInput(String),
UnterminatedString,
StringTooLong(usize),
MalformedEscapeSequence(String),
MalformedNumber(String),
MalformedChar(String),
MalformedIdentifier(String),
ImproperSymbol(String, String),
}
Expand description
Error encountered when tokenizing the script text.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
UnexpectedInput(String)
An unexpected symbol is encountered when tokenizing the script text.
UnterminatedString
A string literal is not terminated before a new-line or EOF.
StringTooLong(usize)
An identifier is in an invalid format.
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 when tokenizing the script text.
Implementations
sourceimpl 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
sourceimpl Error for LexError
impl Error for LexError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<LexError> for ParseErrorType
impl From<LexError> for ParseErrorType
impl Eq for LexError
impl StructuralEq for LexError
impl StructuralPartialEq for LexError
Auto Trait Implementations
impl RefUnwindSafe for LexError
impl Send for LexError
impl Sync for LexError
impl Unpin for LexError
impl UnwindSafe for LexError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more