Enum pomsky_syntax::error::ParseErrorKind
source · #[non_exhaustive]
pub enum ParseErrorKind {
Show 25 variants
Multiple(Box<[ParseError]>),
UnknownToken,
LexErrorWithMessage(LexErrorMsg),
KeywordAfterLet(String),
KeywordAfterColon(String),
NonAsciiIdentAfterColon(char),
GroupNameTooLong(usize),
UnexpectedKeyword(String),
Deprecated(DeprecationError),
Expected(&'static str),
LeftoverTokens,
ExpectedToken(Token),
ExpectedCodePointOrChar,
RangeIsNotIncreasing,
UnallowedNot,
UnallowedMultiNot(usize),
LonePipe,
LetBindingExists,
InvalidEscapeInStringAt(usize),
CharString(CharStringError),
CharClass(CharClassError),
CodePoint(CodePointError),
Number(NumberError),
Repetition(RepetitionError),
RecursionLimit,
}Expand description
An error kind (without a span) than can occur only during parsing
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Multiple(Box<[ParseError]>)
UnknownToken
LexErrorWithMessage(LexErrorMsg)
KeywordAfterLet(String)
KeywordAfterColon(String)
NonAsciiIdentAfterColon(char)
GroupNameTooLong(usize)
UnexpectedKeyword(String)
Deprecated(DeprecationError)
Expected(&'static str)
LeftoverTokens
ExpectedToken(Token)
ExpectedCodePointOrChar
RangeIsNotIncreasing
UnallowedNot
UnallowedMultiNot(usize)
LonePipe
LetBindingExists
InvalidEscapeInStringAt(usize)
CharString(CharStringError)
CharClass(CharClassError)
CodePoint(CodePointError)
Number(NumberError)
Repetition(RepetitionError)
RecursionLimit
Implementations§
source§impl ParseErrorKind
impl ParseErrorKind
sourcepub fn at(self, span: Span) -> ParseError
pub fn at(self, span: Span) -> ParseError
Creates a ParseError from this error kind, and a Span indicating
where the error occurred.
Trait Implementations§
source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
Returns a copy 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 ParseErrorKind
impl Debug for ParseErrorKind
source§impl Display for ParseErrorKind
impl Display for ParseErrorKind
source§impl Error for ParseErrorKind
impl Error for ParseErrorKind
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<CharClassError> for ParseErrorKind
impl From<CharClassError> for ParseErrorKind
source§fn from(e: CharClassError) -> Self
fn from(e: CharClassError) -> Self
Converts to this type from the input type.
source§impl From<DeprecationError> for ParseErrorKind
impl From<DeprecationError> for ParseErrorKind
source§fn from(e: DeprecationError) -> Self
fn from(e: DeprecationError) -> Self
Converts to this type from the input type.
source§impl From<NumberError> for ParseErrorKind
impl From<NumberError> for ParseErrorKind
source§fn from(e: NumberError) -> Self
fn from(e: NumberError) -> Self
Converts to this type from the input type.
source§impl From<RepetitionError> for ParseErrorKind
impl From<RepetitionError> for ParseErrorKind
source§fn from(e: RepetitionError) -> Self
fn from(e: RepetitionError) -> Self
Converts to this type from the input type.