pub enum TokenKind<'a> {
Word(&'a str),
Punct(&'a str),
StrLit(&'a str),
LineComment(&'a str),
BlockComment(&'a str),
Template(&'a str),
Regex(&'a str),
Preproc(&'a str),
Newline,
}Variants§
Word(&'a str)
Identifier, keyword, or numeric literal — anything that requires a word-boundary against another adjacent word.
Punct(&'a str)
Operator or punctuation. May be 1+ characters; multi-character forms
like ===, ??, =>, ->, :: are emitted as a single Punct so
the dangerous-pair table doesn’t have to pull them apart again.
StrLit(&'a str)
String/char literal — emitted verbatim, including delimiters.
LineComment(&'a str)
// … line comment body (without the leading // or trailing
newline). The minifier emits or drops based on keep_comments.
BlockComment(&'a str)
/* … */ block comment body (without the surrounding delimiters).
Template(&'a str)
JS template literal `…` — verbatim, including backticks.
Regex(&'a str)
JS regex literal /…/flags — verbatim.
Preproc(&'a str)
C/C++ preprocessor line, including the leading # and trailing line
continuations. Emitted on its own line.
Newline
Significant newline (used by Strategy B emitters to preserve ASI).