#[non_exhaustive]pub enum TokenKind {
Show 19 variants
LowerId {
qualifier: Option<ModuleName>,
name: Identifier,
},
UpperId {
qualifier: Option<ModuleName>,
name: Identifier,
},
Op(Operator),
IntLit(String),
DecimalLit(String),
StringLit(String),
CharLit(String),
LParen,
RParen,
LBracket,
RBracket,
LBrace,
RBrace,
Comma,
Semi,
Backtick,
VLBrace,
VRBrace,
VSemi,
}Expand description
Token category plus normalized token payload.
std::fmt::Display prints a normalized spelling for diagnostics, logs,
and compact test output. It is not a lossless source renderer: trivia,
original literal escapes, and the distinction between real and virtual
layout punctuation are intentionally not preserved. Use
render_lossless when source-exact reconstruction matters.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LowerId
Lowercase-initial identifier, possibly qualified: foo, Map.lookup.
UpperId
Uppercase-initial identifier, possibly qualified: Foo, DA.Set.Set.
Op(Operator)
Symbolic operator: +, <-, ->, =, =>, ::, ., \, …
IntLit(String)
Integer literal payload as normalized token text.
DecimalLit(String)
Decimal literal payload as normalized token text.
StringLit(String)
String literal value after escape decoding. Use the token span to recover original quotes and escape spelling.
CharLit(String)
Character literal value after escape decoding. Use the token span to recover original quotes and escape spelling.
LParen
(.
RParen
).
LBracket
[.
RBracket
].
LBrace
Explicit { from source.
RBrace
Explicit } from source.
Comma
,.
Semi
Explicit ; from source.
Backtick
`.
VLBrace
Layout-inserted virtual open brace (block start).
VRBrace
Layout-inserted virtual close brace (block end).
VSemi
Layout-inserted virtual semicolon (new item at block indentation).