pub enum ParseErrorType {
Show 41 variants
OtherError(String),
EmptySlice,
EmptyGlobalNames,
EmptyNonlocalNames,
EmptyDeleteTargets,
EmptyImportNames,
EmptyTypeParams,
UnparenthesizedNamedExpression,
UnparenthesizedTupleExpression,
UnparenthesizedGeneratorExpression,
InvalidLambdaExpressionUsage,
InvalidYieldExpressionUsage,
InvalidStarredExpressionUsage,
InvalidStarPatternUsage,
ParamAfterVarKeywordParam,
NonDefaultParamAfterDefaultParam,
VarParameterWithDefault,
DuplicateKeywordArgumentError(String),
InvalidAssignmentTarget,
InvalidNamedAssignmentTarget,
InvalidAnnotatedAssignmentTarget,
InvalidAugmentedAssignmentTarget,
InvalidDeleteTarget,
PositionalAfterKeywordArgument,
PositionalAfterKeywordUnpacking,
InvalidArgumentUnpackingOrder,
IterableUnpackingInComprehension,
SimpleStatementsOnSameLine,
SimpleAndCompoundStatementOnSameLine,
ExpectedKeywordParam,
ExpectedRealNumber,
ExpectedImaginaryNumber,
ExpectedExpression,
ExpectedToken {
expected: TokenKind,
found: TokenKind,
},
UnexpectedIndentation,
UnexpectedTokenAfterAsync(TokenKind),
UnexpectedIpythonEscapeCommand,
UnexpectedExpressionToken,
FStringError(InterpolatedStringErrorType),
TStringError(InterpolatedStringErrorType),
Lexical(LexicalErrorType),
}Expand description
Represents the different types of errors that can occur during parsing.
Variants§
OtherError(String)
An unexpected error occurred.
EmptySlice
An empty slice was found during parsing, e.g data[].
EmptyGlobalNames
An empty global names list was found during parsing.
EmptyNonlocalNames
An empty nonlocal names list was found during parsing.
EmptyDeleteTargets
An empty delete targets list was found during parsing.
EmptyImportNames
An empty import names list was found during parsing.
EmptyTypeParams
An empty type parameter list was found during parsing.
UnparenthesizedNamedExpression
An unparenthesized named expression was found where it is not allowed.
UnparenthesizedTupleExpression
An unparenthesized tuple expression was found where it is not allowed.
UnparenthesizedGeneratorExpression
An unparenthesized generator expression was found where it is not allowed.
InvalidLambdaExpressionUsage
An invalid usage of a lambda expression was found.
InvalidYieldExpressionUsage
An invalid usage of a yield expression was found.
InvalidStarredExpressionUsage
An invalid usage of a starred expression was found.
InvalidStarPatternUsage
A star pattern was found outside a sequence pattern.
ParamAfterVarKeywordParam
A parameter was found after a vararg.
NonDefaultParamAfterDefaultParam
A non-default parameter follows a default parameter.
VarParameterWithDefault
A default value was found for a * or ** parameter.
DuplicateKeywordArgumentError(String)
A keyword argument was repeated.
InvalidAssignmentTarget
An invalid expression was found in the assignment target.
InvalidNamedAssignmentTarget
An invalid expression was found in the named assignment target.
InvalidAnnotatedAssignmentTarget
An invalid expression was found in the annotated assignment target.
InvalidAugmentedAssignmentTarget
An invalid expression was found in the augmented assignment target.
InvalidDeleteTarget
An invalid expression was found in the delete target.
PositionalAfterKeywordArgument
A positional argument was found after a keyword argument.
PositionalAfterKeywordUnpacking
A positional argument was found after a keyword argument unpacking.
InvalidArgumentUnpackingOrder
An iterable argument unpacking was found after keyword argument unpacking.
IterableUnpackingInComprehension
An invalid usage of iterable unpacking in a comprehension was found.
SimpleStatementsOnSameLine
Multiple simple statements were found in the same line without a ; separating them.
SimpleAndCompoundStatementOnSameLine
A simple statement and a compound statement was found in the same line.
ExpectedKeywordParam
Expected one or more keyword parameter after * separator.
ExpectedRealNumber
Expected a real number for a complex literal pattern.
ExpectedImaginaryNumber
Expected an imaginary number for a complex literal pattern.
ExpectedExpression
Expected an expression at the current parser location.
ExpectedToken
The parser expected a specific token that was not found.
UnexpectedIndentation
An unexpected indentation was found during parsing.
UnexpectedTokenAfterAsync(TokenKind)
The statement being parsed cannot be async.
UnexpectedIpythonEscapeCommand
Ipython escape command was found
UnexpectedExpressionToken
An unexpected token was found at the end of an expression parsing
FStringError(InterpolatedStringErrorType)
An f-string error containing the InterpolatedStringErrorType.
TStringError(InterpolatedStringErrorType)
A t-string error containing the InterpolatedStringErrorType.
Lexical(LexicalErrorType)
Parser encountered an error during lexing.
Trait Implementations§
Source§impl Clone for ParseErrorType
impl Clone for ParseErrorType
Source§fn clone(&self) -> ParseErrorType
fn clone(&self) -> ParseErrorType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseErrorType
impl Debug for ParseErrorType
Source§impl Display for ParseErrorType
impl Display for ParseErrorType
Source§impl Error for ParseErrorType
impl Error for ParseErrorType
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl GetSize for ParseErrorType
impl GetSize for ParseErrorType
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)
fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl PartialEq for ParseErrorType
impl PartialEq for ParseErrorType
impl Eq for ParseErrorType
impl StructuralPartialEq for ParseErrorType
Auto Trait Implementations§
impl Freeze for ParseErrorType
impl RefUnwindSafe for ParseErrorType
impl Send for ParseErrorType
impl Sync for ParseErrorType
impl Unpin for ParseErrorType
impl UnsafeUnpin for ParseErrorType
impl UnwindSafe for ParseErrorType
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more