pub enum TokenKind {
Show 35 variants
LineComment,
BlockComment {
terminated: bool,
},
Whitespace,
Ident,
RawIdent,
Literal {
kind: LiteralKind,
suffix_start: usize,
},
Lifetime {
starts_with_number: bool,
},
Semi,
Comma,
Dot,
OpenParen,
CloseParen,
OpenBrace,
CloseBrace,
OpenBracket,
CloseBracket,
At,
Pound,
Tilde,
Question,
Colon,
Dollar,
Eq,
Not,
Lt,
Gt,
Minus,
And,
Or,
Plus,
Star,
Slash,
Caret,
Percent,
Unknown,
}
Expand description
Enum representing common lexeme types.
Variants§
LineComment
“// comment”
BlockComment
“/* block comment /” Block comments can be recursive, so the sequence like “/ /* */” will not be considered terminated and will result in a parsing error.
Whitespace
Any whitespace characters sequence.
Ident
“ident” or “continue” At this step keywords are also considered identifiers.
RawIdent
“r#ident”
Literal
“12_u8”, “1.0e-40”, “b“123”“. See LiteralKind
for more details.
Lifetime
“’a”
Semi
“;”
Comma
“,”
Dot
“.”
OpenParen
“(”
CloseParen
“)”
OpenBrace
“{”
CloseBrace
“}”
OpenBracket
“[”
CloseBracket
“]”
At
“@”
Pound
“#”
Tilde
“~”
Question
“?”
Colon
“:”
Dollar
“$”
Eq
“=”
Not
“!”
Lt
“<”
Gt
“>”
Minus
“-”
And
“&”
Or
“|”
Plus
“+”
Star
“*”
Slash
“/”
Caret
“^”
Percent
“%”
Unknown
Unknown token, not expected by the lexer, e.g. “№”
Trait Implementations§
Source§impl Ord for TokenKind
impl Ord for TokenKind
Source§impl PartialOrd for TokenKind
impl PartialOrd for TokenKind
impl Copy for TokenKind
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 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
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
)