Enum swc_ecma_parser::token::Token [−][src]
pub enum Token {
Show 36 variants
Word(Word),
Arrow,
Hash,
At,
Dot,
DotDotDot,
Bang,
LParen,
RParen,
LBracket,
RBracket,
LBrace,
RBrace,
Semi,
Comma,
BackQuote,
Template {
raw: JsWord,
cooked: Result<JsWord, Error>,
has_escape: bool,
},
Colon,
ColonColon,
BinOp(BinOpToken),
AssignOp(AssignOpToken),
DollarLBrace,
QuestionMark,
PlusPlus,
MinusMinus,
Tilde,
Str {
value: JsWord,
has_escape: bool,
},
Regex(JsWord, JsWord),
Num(f64),
BigInt(BigIntValue),
JSXName {
name: JsWord,
},
JSXText {
raw: JsWord,
},
JSXTagStart,
JSXTagEnd,
Shebang(JsWord),
Error(Error),
}
Variants
Word(Word)
Tuple Fields
0: Word
Identifier, “null”, “true”, “false”.
Contains null
and ``
Arrow
‘=>’
Hash
‘#’
At
‘@’
Dot
‘.’
DotDotDot
‘…’
Bang
‘!’
LParen
‘(’
RParen
‘)’
LBracket
[
RBracket
‘]’
LBrace
‘{’
RBrace
‘}’
Semi
‘;’
Comma
‘,’
BackQuote
‘`’
Template
Colon
‘:’
ColonColon
‘::’
BinOp(BinOpToken)
Tuple Fields
0: BinOpToken
AssignOp(AssignOpToken)
Tuple Fields
DollarLBrace
‘${’
QuestionMark
‘?’
PlusPlus
++
MinusMinus
--
Tilde
~
Str
Fields
value: JsWord
has_escape: bool
This field exists because ‘use\x20strict’ is not an use strict directive.
String literal. Span of this token contains quote.
Regex(JsWord, JsWord)
Regexp literal.
Num(f64)
Tuple Fields
0: f64
TODO: Make Num as enum and separate decimal, binary, ..etc
BigInt(BigIntValue)
Tuple Fields
0: BigIntValue
JSXName
Fields
name: JsWord
JSXText
Fields
raw: JsWord
JSXTagStart
JSXTagEnd
Shebang(JsWord)
Tuple Fields
0: JsWord
Error(Error)
Tuple Fields
0: Error
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl UnwindSafe for Token
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more