#[repr(u16)]pub enum Token {
Show 36 variants
IDENT_KW = 1,
DEFINED = 2,
DIGITS = 3,
PERIOD = 4,
PLUS = 5,
DASH = 6,
SLASH = 7,
ASTERISK = 8,
PERCENT = 9,
LANGLE = 10,
RANGLE = 11,
LBRACKET = 12,
RBRACKET = 13,
LPAREN = 14,
RPAREN = 15,
LBRACE = 16,
RBRACE = 17,
CARET = 18,
BAR = 19,
AMPERSAND = 20,
TILDE = 21,
EQUAL = 22,
BANG = 23,
COLON = 24,
SEMICOLON = 25,
COMMA = 26,
QUESTION = 27,
HASH = 28,
QUOTE_STRING = 29,
ANGLE_STRING = 30,
BACKSLASH = 31,
WS = 32,
NEWLINE = 33,
COMMENT = 34,
LINECONT = 35,
ERROR = 36,
}
Variants§
IDENT_KW = 1
Identifier or keyword
DEFINED = 2
defined preprocessor keyword
DIGITS = 3
Digit sequence
PERIOD = 4
.
PLUS = 5
DASH = 6
SLASH = 7
/
ASTERISK = 8
PERCENT = 9
%
LANGLE = 10
<
RANGLE = 11
LBRACKET = 12
[
RBRACKET = 13
]
LPAREN = 14
(
RPAREN = 15
)
LBRACE = 16
{
RBRACE = 17
}
CARET = 18
^
BAR = 19
|
AMPERSAND = 20
&
TILDE = 21
~
EQUAL = 22
=
BANG = 23
!
COLON = 24
:
SEMICOLON = 25
;
COMMA = 26
,
QUESTION = 27
?
HASH = 28
QUOTE_STRING = 29
“string”
ANGLE_STRING = 30
BACKSLASH = 31
\
WS = 32
Whitespace
NEWLINE = 33
Newline
COMMENT = 34
Comment (single-line or multi-line)
LINECONT = 35
Line continuation (required for tracking exact offsets)
ERROR = 36
Invalid token
Implementations§
Trait Implementations§
impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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