pub enum TokenKind {
Show 85 variants
Ident,
Int(u64),
Float(f64),
Str(String),
FStr(Vec<FPart>),
DocOuter(String),
DocInner(String),
Newline,
Module,
Extern,
Impl,
Fn,
Pub,
Let,
Var,
Type,
Struct,
Enum,
Interface,
If,
Else,
Match,
While,
For,
In,
Return,
Break,
Continue,
Loop,
Mut,
Own,
SelfValue,
SelfType,
True,
False,
Async,
Await,
LParen,
RParen,
LBracket,
RBracket,
LBrace,
RBrace,
Comma,
Dot,
DotDot,
DotDotEq,
Colon,
Question,
Underscore,
Eq,
Arrow,
FatArrow,
Plus,
Minus,
Star,
Slash,
Percent,
EqEq,
NotEq,
Lt,
Le,
Gt,
Ge,
AndAnd,
OrOr,
Bang,
Amp,
Pipe,
Caret,
Tilde,
Shl,
Shr,
PlusEq,
MinusEq,
StarEq,
SlashEq,
PercentEq,
AmpEq,
PipeEq,
CaretEq,
ShlEq,
ShrEq,
Error,
Eof,
}Expand description
The kind of a token, with the value of literals.
Variants§
Ident
An identifier. Contextual keywords (imports, as, from, …) are identifiers too.
Int(u64)
An integer literal. The value is at most 2^63 (spec chapter 1, section 5.1).
Float(f64)
A float literal.
Str(String)
A string literal, with escapes already resolved. Raw (r"...") and multiline (""")
strings are string literals too.
FStr(Vec<FPart>)
An interpolated string f"..." (spec chapter 1, section 5.3a), split into its parts.
DocOuter(String)
An outer doc comment (/// or /** */) with its text after the marker.
DocInner(String)
An inner doc comment (//! or /*! */) with its text after the marker.
Newline
One or more line ends (spec chapter 1, section 7).
Module
module
Extern
extern
Impl
impl
Fn
fn
Pub
pub
Let
let
Var
var
Type
type
Struct
struct
Enum
enum
Interface
interface
If
if
Else
else
Match
match
While
while
For
for
In
in
Return
return
Break
break
Continue
continue
Loop
loop
Mut
mut
Own
own
SelfValue
self
SelfType
Self
True
true
False
false
Async
async (reserved for the future)
Await
await (reserved for the future)
LParen
(
RParen
)
LBracket
[
RBracket
]
LBrace
{
RBrace
}
Comma
,
Dot
.
DotDot
..
DotDotEq
..=
Colon
:
Question
?
Underscore
_
Eq
=
Arrow
->
FatArrow
=>
Plus
+
Minus
-
Star
*
Slash
/
Percent
%
EqEq
==
NotEq
!=
Lt
<
Le
<=
Gt
>
Ge
>=
AndAnd
&&
OrOr
||
Bang
!
Amp
&
Pipe
|
Caret
^
Tilde
~
Shl
<<
Shr
>>
PlusEq
+=
MinusEq
-=
StarEq
*=
SlashEq
/=
PercentEq
%=
AmpEq
&=
PipeEq
|=
CaretEq
^=
ShlEq
<<=
ShrEq
>>=
Error
Text that could not be lexed. A diagnostic has been reported for it.
Eof
The end of the file. Always the last token.