pub enum LexError {
UnterminatedString {
start: Position,
},
InvalidEscape {
escape: char,
pos: Position,
},
InvalidNumber {
text: String,
pos: Position,
},
InvalidIdentifier {
text: String,
pos: Position,
},
UnexpectedByte {
byte: u8,
pos: Position,
},
InvalidUtf8 {
pos: Position,
},
}Expand description
Errors produced by tokenize.
Variants§
UnterminatedString
A "-quoted string was not terminated before end-of-input.
InvalidEscape
A \x escape sequence used an unsupported character.
InvalidNumber
A numeric token could not be parsed.
InvalidIdentifier
An identifier or kind annotation is ill-formed.
UnexpectedByte
A byte that cannot start any token (e.g. stray punctuation).
InvalidUtf8
Input was not valid UTF-8 at the cursor.
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)>
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 From<LexError> for ParseError
impl From<LexError> for ParseError
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 UnsafeUnpin 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