pub enum LexicalErrorType {
Show 15 variants
UnicodeError,
NestingError,
IndentationError,
TabError,
TabsAfterSpaces,
DefaultArgumentError,
DuplicateArgumentError(String),
PositionalArgumentError,
UnpackedArgumentError,
DuplicateKeywordArgumentError(String),
UnrecognizedToken {
tok: char,
},
FStringError(FStringErrorType),
LineContinuationError,
Eof,
OtherError(String),
// some variants omitted
}
Expand description
Represents the different types of errors that can occur during lexing.
Variants§
UnicodeError
Decoding of a unicode escape sequence in a string literal failed.
NestingError
The nesting of brackets/braces/parentheses is not balanced.
IndentationError
The indentation is not consistent.
TabError
Inconsistent use of tabs and spaces.
TabsAfterSpaces
Encountered a tab after a space.
DefaultArgumentError
A non-default argument follows a default argument.
DuplicateArgumentError(String)
A duplicate argument was found in a function definition.
PositionalArgumentError
A positional argument follows a keyword argument.
UnpackedArgumentError
An iterable argument unpacking *args
follows keyword argument unpacking **kwargs
.
DuplicateKeywordArgumentError(String)
A keyword argument was repeated.
UnrecognizedToken
An unrecognized token was encountered.
FStringError(FStringErrorType)
An f-string error containing the FStringErrorType
.
LineContinuationError
An unexpected character was encountered after a line continuation.
Eof
An unexpected end of file was encountered.
OtherError(String)
An unexpected error occurred.
Trait Implementations§
Source§impl Debug for LexicalErrorType
impl Debug for LexicalErrorType
Source§impl Display for LexicalErrorType
impl Display for LexicalErrorType
Source§impl PartialEq for LexicalErrorType
impl PartialEq for LexicalErrorType
impl StructuralPartialEq for LexicalErrorType
Auto Trait Implementations§
impl Freeze for LexicalErrorType
impl RefUnwindSafe for LexicalErrorType
impl Send for LexicalErrorType
impl Sync for LexicalErrorType
impl Unpin for LexicalErrorType
impl UnwindSafe for LexicalErrorType
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more