Enum dprint_swc_ecma_ast_view::Token [−]
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: Atom<JsWordStaticSet>, cooked: Option<Atom<JsWordStaticSet>>, has_escape: bool, }, Colon, ColonColon, BinOp(BinOpToken), AssignOp(AssignOp), DollarLBrace, QuestionMark, PlusPlus, MinusMinus, Tilde, Str { value: Atom<JsWordStaticSet>, has_escape: bool, }, Regex(Atom<JsWordStaticSet>, Atom<JsWordStaticSet>), Num(f64), BigInt(BigInt), JSXName { name: Atom<JsWordStaticSet>, }, JSXText { raw: Atom<JsWordStaticSet>, }, JSXTagStart, JSXTagEnd, Shebang(Atom<JsWordStaticSet>), Error(Error),
Variants
Identifier, “null”, “true”, “false”.
Contains null
and ``
‘=>’
‘#’
‘@’
‘.’
‘…’
‘!’
‘(’
‘)’
[
‘]’
‘{’
‘}’
‘;’
‘,’
‘`’
Fields of Template
‘:’
‘::’
AssignOp(AssignOp)
‘${’
‘?’
++
--
~
String literal. Span of this token contains quote.
Fields of Str
value: Atom<JsWordStaticSet>
has_escape: bool
This field exists because ‘use\x20strict’ is not an use strict directive.
Regex(Atom<JsWordStaticSet>, Atom<JsWordStaticSet>)
Regexp literal.
Num(f64)
TODO: Make Num as enum and separate decimal, binary, ..etc
BigInt(BigInt)
Fields of JSXName
name: Atom<JsWordStaticSet>
Fields of JSXText
raw: Atom<JsWordStaticSet>
Shebang(Atom<JsWordStaticSet>)
Implementations
impl Token
impl Token
pub fn starts_expr(&self) -> bool
pub fn before_expr(&self) -> bool
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl UnwindSafe for Token
Blanket Implementations
Mutably borrows from an owned value. Read more