pub enum Kind {
}Expand description
What kind of token it is.
Variants§
Eof
The end of the input; the lexer gives it again on every call after.
Hashbang
#! at the very start of the input, to the end of the line.
LineComment
// ..., to the end of the line.
BlockComment
/* ... */.
HtmlOpenComment
Annex B’s <!--, to the end of the line, in scripts only.
HtmlCloseComment
Annex B’s --> at the start of a line, to its end, in scripts only.
Ident
An IdentifierName that isn’t a keyword spelled plainly.
Keyword(Keyword)
An IdentifierName spelled as one of these words, with no escapes.
PrivateName
#name, a private name.
Number
A NumericLiteral that isn’t a BigInt.
BigInt
A NumericLiteral ending in n.
String
A StringLiteral, quotes included.
Template
A NoSubstitutionTemplate: `...`.
TemplateHead
A TemplateHead: `...${.
TemplateMiddle
A TemplateMiddle: }...${.
TemplateTail
A TemplateTail: }...`.
RegExp
A RegularExpressionLiteral, /body/flags. The lexer checks the
flags; the body is checked against the pattern grammar later.
Punct(Punct)
Invalid
A character that starts no token, or a \ that starts no escape.
The lexer has reported it.