pub enum SyntaxError {
Show 67 variants
AsciiEscapeCodeOutOfRange,
ExpectedArgsEnd,
ExpectedAssignmentTarget,
ExpectedAssignmentAfterMetaKey,
ExpectedCatchArgument,
ExpectedCatch,
ExpectedCloseParen,
ExpectedDefaultValue,
ExpectedElseExpression,
ExpectedElseIfCondition,
ExpectedExpression,
ExpectedForArgs,
ExpectedForInKeyword,
ExpectedForIterable,
ExpectedFormatString,
ExpectedFunctionArgsEnd,
ExpectedIdInImportExpression,
ExpectedIfCondition,
ExpectedImportAfterFrom,
ExpectedImportModuleId,
ExpectedIndexEnd,
ExpectedIndexExpression,
ExpectedIdAfterAs,
ExpectedListEnd,
ExpectedMapColon,
ExpectedMapEnd,
ExpectedMapEntry,
ExpectedMapKey,
ExpectedMapValue,
ExpectedMatchArmExpression,
ExpectedMatchArmExpressionAfterThen,
ExpectedMatchCondition,
ExpectedMatchExpression,
ExpectedMatchPattern,
ExpectedMetaId,
ExpectedPathAfterFrom,
ExpectedLineBreakBeforeMapBlock,
ExpectedStringPlaceholderEnd,
ExpectedSwitchArmExpression,
ExpectedSwitchArmExpressionAfterThen,
ExpectedTestName,
ExpectedThenExpression,
ExpectedUntilCondition,
ExpectedWhileCondition,
ExpectedType,
FormatStringError(StringFormatError),
IfBlockNotAllowedInThisContext,
MatchEllipsisOutsideOfNestedPatterns,
MatchElseNotInLastArm,
MissingModuleForWildcardImport,
NestedTypesArentSupported,
ReservedKeyword,
SelfArg,
SwitchElseNotInLastArm,
UnexpectedCharInNumericEscapeCode,
UnexpectedDotAfterImportItem,
UnexpectedEscapeInString,
UnexpectedMatchElse,
UnexpectedMatchIf,
UnexpectedMetaKey,
UnexpectedSwitchElse,
UnexpectedSwitchThen,
UnexpectedNullCheck,
UnexpectedToken,
UnicodeEscapeCodeOutOfRange,
UnterminatedNumericEscapeCode,
UnterminatedString,
}Expand description
A syntax error encountered by the Parser
Variants§
AsciiEscapeCodeOutOfRange
ExpectedArgsEnd
ExpectedAssignmentTarget
ExpectedAssignmentAfterMetaKey
ExpectedCatchArgument
ExpectedCatch
ExpectedCloseParen
ExpectedDefaultValue
ExpectedElseExpression
ExpectedElseIfCondition
ExpectedExpression
ExpectedForArgs
ExpectedForInKeyword
ExpectedForIterable
ExpectedFormatString
ExpectedFunctionArgsEnd
ExpectedIdInImportExpression
ExpectedIfCondition
ExpectedImportAfterFrom
ExpectedImportModuleId
ExpectedIndexEnd
ExpectedIndexExpression
ExpectedIdAfterAs
ExpectedListEnd
ExpectedMapColon
ExpectedMapEnd
ExpectedMapEntry
ExpectedMapKey
ExpectedMapValue
ExpectedMatchArmExpression
ExpectedMatchArmExpressionAfterThen
ExpectedMatchCondition
ExpectedMatchExpression
ExpectedMatchPattern
ExpectedMetaId
ExpectedPathAfterFrom
ExpectedLineBreakBeforeMapBlock
ExpectedStringPlaceholderEnd
ExpectedSwitchArmExpression
ExpectedSwitchArmExpressionAfterThen
ExpectedTestName
ExpectedThenExpression
ExpectedUntilCondition
ExpectedWhileCondition
ExpectedType
FormatStringError(StringFormatError)
IfBlockNotAllowedInThisContext
MatchEllipsisOutsideOfNestedPatterns
MatchElseNotInLastArm
MissingModuleForWildcardImport
NestedTypesArentSupported
ReservedKeyword
SelfArg
SwitchElseNotInLastArm
UnexpectedCharInNumericEscapeCode
UnexpectedDotAfterImportItem
UnexpectedEscapeInString
UnexpectedMatchElse
UnexpectedMatchIf
UnexpectedMetaKey
UnexpectedSwitchElse
UnexpectedSwitchThen
UnexpectedNullCheck
UnexpectedToken
UnicodeEscapeCodeOutOfRange
UnterminatedNumericEscapeCode
UnterminatedString
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
Source§impl Error for SyntaxError
impl Error for SyntaxError
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<SyntaxError> for ErrorKind
impl From<SyntaxError> for ErrorKind
Source§fn from(source: SyntaxError) -> Self
fn from(source: SyntaxError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnwindSafe for SyntaxError
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