Enum dprint_swc_ecma_ast_view::Token[]

pub enum Token {
Show 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

Word(Word)

Identifier, “null”, “true”, “false”.

Contains null and ``

Arrow

‘=>’

Hash

‘#’

At

‘@’

Dot

‘.’

DotDotDot

‘…’

Bang

‘!’

LParen

‘(’

RParen

‘)’

LBracket

[

RBracket

‘]’

LBrace

‘{’

RBrace

‘}’

Semi

‘;’

Comma

‘,’

BackQuote

‘`’

Template
Show fields

Fields of Template

raw: Atom<JsWordStaticSet>cooked: Option<Atom<JsWordStaticSet>>has_escape: bool
Colon

‘:’

ColonColon

‘::’

BinOp(BinOpToken)
AssignOp(AssignOp)
DollarLBrace

‘${’

QuestionMark

‘?’

PlusPlus

++

MinusMinus

--

Tilde

~

Str

String literal. Span of this token contains quote.

Show fields

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)
JSXName
Show fields

Fields of JSXName

name: Atom<JsWordStaticSet>
JSXText
Show fields

Fields of JSXText

raw: Atom<JsWordStaticSet>
JSXTagStart
JSXTagEnd
Shebang(Atom<JsWordStaticSet>)
Error(Error)

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

This method is called only in the case of parsing failure.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.