pub enum TokenKind {
Show 56 variants
Fn,
Pub,
Let,
Mut,
Struct,
Mod,
If,
Else,
While,
Break,
Continue,
Return,
Enum,
Impl,
Match,
For,
In,
SelfKw,
ReservedKeyword(String),
Identifier(String),
IntegerLiteral(String),
FloatLiteral(String),
StringLiteral(String),
BoolLiteral(bool),
Lifetime(String),
Plus,
Minus,
Star,
Slash,
Percent,
Eq,
EqEq,
NotEq,
Lt,
LtEq,
Gt,
GtEq,
Bang,
AmpAmp,
PipePipe,
Amp,
ColonColon,
Colon,
Semi,
Comma,
Dot,
DotDot,
LParen,
RParen,
LBrace,
RBrace,
LBracket,
RBracket,
Arrow,
FatArrow,
Question,
}Expand description
The kind of a lexical token. Keywords that are part of the Varyk
surface (spec 4.1) each get their own variant; every other Rust keyword
and reserved word, including the 2024-edition ones, lexes as
TokenKind::ReservedKeyword carrying its text, so the parser can report
it by name.
Variants§
Fn
Pub
Let
Mut
Struct
Mod
If
Else
While
Break
Continue
Return
Enum
Impl
Match
For
In
SelfKw
self, spec 2.1. Self is unrelated and still lexes as
TokenKind::ReservedKeyword: milestone 2 has no way to write it.
ReservedKeyword(String)
Any other Rust keyword or reserved word, carrying its text.
Identifier(String)
IntegerLiteral(String)
Raw source text of an integer literal, digits only.
FloatLiteral(String)
Raw source text of a float literal, digits . digits.
StringLiteral(String)
Raw source text between the quotes of a string literal, unmodified.
BoolLiteral(bool)
Lifetime(String)
A 'ident lifetime, carrying the identifier without the quote.
Plus
Minus
Star
Slash
Percent
Eq
EqEq
NotEq
Lt
LtEq
Gt
GtEq
Bang
AmpAmp
PipePipe
Amp
ColonColon
Colon
Semi
Comma
Dot
DotDot
LParen
RParen
LBrace
RBrace
LBracket
RBracket
Arrow
FatArrow
Question
Trait Implementations§
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKind
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