Enum boa::syntax::lexer::token::TokenKind [−][src]
pub enum TokenKind {
Show 13 variants
BooleanLiteral(bool),
EOF,
Identifier(Box<str>),
Keyword(Keyword),
NullLiteral,
NumericLiteral(Numeric),
Punctuator(Punctuator),
StringLiteral(Box<str>),
TemplateNoSubstitution(TemplateString),
TemplateMiddle(TemplateString),
RegularExpressionLiteral(Box<str>, RegExpFlags),
LineTerminator,
Comment,
}Expand description
Represents the type of Token and the data it has inside.
Variants
BooleanLiteral(bool)A boolean literal, which is either true or false.
Tuple Fields of BooleanLiteral
0: boolThe end of the file.
An identifier.
Keyword(Keyword)A keyword.
see: Keyword
Tuple Fields of Keyword
0: KeywordA null literal.
NumericLiteral(Numeric)A numeric literal.
Tuple Fields of NumericLiteral
0: NumericPunctuator(Punctuator)A piece of punctuation
see: Punctuator
Tuple Fields of Punctuator
0: PunctuatorA string literal.
A part of a template literal without substitution.
The part of a template literal between substitutions
A regular expression, consisting of body and flags.
Indicates the end of a line (\n).
Indicates a comment, the content isn’t stored.
Implementations
Creates a BooleanLiteral token kind.
Creates an Identifier token type.
Creates a NumericLiteral token kind.
Creates a Punctuator token type.
Creates a StringLiteral token type.
Creates a RegularExpressionLiteral token kind.
Creates a LineTerminator token kind.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for TokenKind
impl UnwindSafe for TokenKind
Blanket Implementations
Mutably borrows from an owned value. Read more