Enum pomsky_syntax::diagnose::CharClassError
source · #[non_exhaustive]
pub enum CharClassError {
Empty,
CaretInGroup,
DescendingRange(char, char),
Invalid,
Unallowed,
UnknownNamedClass {
found: Box<str>,
},
Negative,
}Expand description
An error that relates to a character class
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.
Empty
Empty character class, i.e. []
CaretInGroup
This error is created when [^ is encountered. This is a negated
character class in a regex, but pomsky instead uses the ![ syntax.
DescendingRange(char, char)
Descending code point range, e.g. ['z'-'a']
Invalid
Invalid token within a character class
Unallowed
Character class contains incompatible shorthands, e.g. [. codepoint]
UnknownNamedClass
Unknown shorthand character class or Unicode property
Negative
A character class that can’t be negated, e.g. [!ascii]
Trait Implementations§
source§impl Clone for CharClassError
impl Clone for CharClassError
source§fn clone(&self) -> CharClassError
fn clone(&self) -> CharClassError
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 CharClassError
impl Debug for CharClassError
source§impl Display for CharClassError
impl Display for CharClassError
source§impl Error for CharClassError
impl Error for CharClassError
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 PartialEq<CharClassError> for CharClassError
impl PartialEq<CharClassError> for CharClassError
source§fn eq(&self, other: &CharClassError) -> bool
fn eq(&self, other: &CharClassError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.