Enum rustpython_parser::lexer::LexicalErrorType
source · 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<LexicalErrorType> for LexicalErrorType
impl PartialEq<LexicalErrorType> for LexicalErrorType
source§fn eq(&self, other: &LexicalErrorType) -> bool
fn eq(&self, other: &LexicalErrorType) -> bool
self
and other
values to be equal, and is used
by ==
.