pub enum SimpleCharSet {
None,
Number(NumberState),
Identifier,
String(bool),
Singleton,
Comparison,
Dot,
Whitespace,
Other,
BreakNext(Option<SimpleCharSetTokenKind>),
}
Variants§
None
Number(NumberState)
A number, which can be an integer, or a floating-point number
Identifier
An identifier consists of a character with the Unicode XID_Start
property, followed by a
sequence of characters with the Unicode XID_continue
property
String(bool)
A string delimited by double quotes ("
). The boolean indicates whether an odd number of
backslashes have been matched (and thus the next "
is escaped).
Singleton
A character which forms a token on its own
Comparison
Tokens starting with <
, =
, >
can only contain other characters from that set.
Dot
.
is part of a number if followed by a digit, or part of a punctuation tag otherwise.
Whitespace
Whitespace isn’t part of any token
Other
Any character not covered by the above categories
BreakNext(Option<SimpleCharSetTokenKind>)
The next character will not be in this token
Implementations§
Source§impl SimpleCharSet
impl SimpleCharSet
fn categorize(ch: char) -> Self
Trait Implementations§
Source§impl CharSet<char> for SimpleCharSet
impl CharSet<char> for SimpleCharSet
type TokenKind = SimpleCharSetTokenKind
type Error = SimpleCharSetError
Source§impl Clone for SimpleCharSet
impl Clone for SimpleCharSet
Source§fn clone(&self) -> SimpleCharSet
fn clone(&self) -> SimpleCharSet
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 SimpleCharSet
impl Debug for SimpleCharSet
Source§impl Default for SimpleCharSet
impl Default for SimpleCharSet
Source§fn default() -> SimpleCharSet
fn default() -> SimpleCharSet
Returns the “default value” for a type. Read more
Source§impl PartialEq for SimpleCharSet
impl PartialEq for SimpleCharSet
impl Copy for SimpleCharSet
impl Eq for SimpleCharSet
impl StructuralPartialEq for SimpleCharSet
Auto Trait Implementations§
impl Freeze for SimpleCharSet
impl RefUnwindSafe for SimpleCharSet
impl Send for SimpleCharSet
impl Sync for SimpleCharSet
impl Unpin for SimpleCharSet
impl UnwindSafe for SimpleCharSet
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
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> ⓘ
Converts
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> ⓘ
Converts
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 more