Skip to main content

JavaScriptTokenType

Enum JavaScriptTokenType 

Source
#[repr(u8)]
pub enum JavaScriptTokenType {
Show 122 variants Abstract = 0, As = 1, Async = 2, Await = 3, Break = 4, Case = 5, Catch = 6, Class = 7, Const = 8, Continue = 9, Debugger = 10, Default = 11, Delete = 12, Do = 13, Else = 14, Enum = 15, Export = 16, Extends = 17, False = 18, Finally = 19, For = 20, Function = 21, If = 22, Implements = 23, Import = 24, In = 25, Instanceof = 26, Interface = 27, Let = 28, New = 29, Null = 30, Package = 31, Private = 32, Protected = 33, Public = 34, Return = 35, Static = 36, Super = 37, Switch = 38, This = 39, Throw = 40, True = 41, Try = 42, Typeof = 43, Undefined = 44, Var = 45, Void = 46, While = 47, With = 48, Yield = 49, Plus = 50, Minus = 51, Star = 52, Slash = 53, Percent = 54, StarStar = 55, PlusPlus = 56, MinusMinus = 57, LeftShift = 58, RightShift = 59, UnsignedRightShift = 60, Less = 61, Greater = 62, LessEqual = 63, GreaterEqual = 64, EqualEqual = 65, NotEqual = 66, EqualEqualEqual = 67, NotEqualEqual = 68, Ampersand = 69, Pipe = 70, Caret = 71, Exclamation = 72, Tilde = 73, AmpersandAmpersand = 74, PipePipe = 75, Question = 76, QuestionQuestion = 77, QuestionDot = 78, Equal = 79, PlusEqual = 80, MinusEqual = 81, StarEqual = 82, SlashEqual = 83, PercentEqual = 84, StarStarEqual = 85, LeftShiftEqual = 86, RightShiftEqual = 87, UnsignedRightShiftEqual = 88, AmpersandEqual = 89, PipeEqual = 90, CaretEqual = 91, AmpersandAmpersandEqual = 92, PipePipeEqual = 93, QuestionQuestionEqual = 94, LeftParen = 95, RightParen = 96, LeftBrace = 97, RightBrace = 98, LeftBracket = 99, RightBracket = 100, Semicolon = 101, Comma = 102, Dot = 103, DotDotDot = 104, Colon = 105, Arrow = 106, StringLiteral = 107, NumericLiteral = 108, BigIntLiteral = 109, RegexLiteral = 110, TemplateString = 111, TemplateHead = 112, TemplateMiddle = 113, TemplateTail = 114, IdentifierName = 115, LineComment = 116, BlockComment = 117, Whitespace = 118, Newline = 119, Eof = 120, Error = 121,
}
Expand description

JavaScript token types.

Variants§

§

Abstract = 0

abstract

§

As = 1

as

§

Async = 2

async

§

Await = 3

await

§

Break = 4

break

§

Case = 5

case

§

Catch = 6

catch

§

Class = 7

class

§

Const = 8

const

§

Continue = 9

continue

§

Debugger = 10

debugger

§

Default = 11

default

§

Delete = 12

delete

§

Do = 13

do

§

Else = 14

else

§

Enum = 15

enum

§

Export = 16

export

§

Extends = 17

extends

§

False = 18

false

§

Finally = 19

finally

§

For = 20

for

§

Function = 21

function

§

If = 22

if

§

Implements = 23

implements

§

Import = 24

import

§

In = 25

in

§

Instanceof = 26

instanceof

§

Interface = 27

interface

§

Let = 28

let

§

New = 29

new

§

Null = 30

null

§

Package = 31

package

§

Private = 32

private

§

Protected = 33

protected

§

Public = 34

public

§

Return = 35

return

§

Static = 36

static

§

Super = 37

super

§

Switch = 38

switch

§

This = 39

this

§

Throw = 40

throw

§

True = 41

true

§

Try = 42

try

§

Typeof = 43

typeof

§

Undefined = 44

undefined

§

Var = 45

var

§

Void = 46

void

§

While = 47

while

§

With = 48

with

§

Yield = 49

yield

§

Plus = 50

+

§

Minus = 51

-

§

Star = 52

*

§

Slash = 53

/

§

Percent = 54

%

§

StarStar = 55

**

§

PlusPlus = 56

++

§

MinusMinus = 57

--

§

LeftShift = 58

<<

§

RightShift = 59

>>

§

UnsignedRightShift = 60

>>>

§

Less = 61

<

§

Greater = 62

>

§

LessEqual = 63

<=

§

GreaterEqual = 64

>=

§

EqualEqual = 65

==

§

NotEqual = 66

!=

§

EqualEqualEqual = 67

===

§

NotEqualEqual = 68

!==

§

Ampersand = 69

&

§

Pipe = 70

|

§

Caret = 71

^

§

Exclamation = 72

!

§

Tilde = 73

~

§

AmpersandAmpersand = 74

&&

§

PipePipe = 75

||

§

Question = 76

?

§

QuestionQuestion = 77

??

§

QuestionDot = 78

?.

§

Equal = 79

=

§

PlusEqual = 80

+=

§

MinusEqual = 81

-=

§

StarEqual = 82

*=

§

SlashEqual = 83

/=

§

PercentEqual = 84

%=

§

StarStarEqual = 85

**=

§

LeftShiftEqual = 86

<<=

§

RightShiftEqual = 87

>>=

§

UnsignedRightShiftEqual = 88

>>>=

§

AmpersandEqual = 89

&=

§

PipeEqual = 90

|=

§

CaretEqual = 91

^=

§

AmpersandAmpersandEqual = 92

&&=

§

PipePipeEqual = 93

||=

§

QuestionQuestionEqual = 94

??=

§

LeftParen = 95

(

§

RightParen = 96

)

§

LeftBrace = 97

{

§

RightBrace = 98

}

§

LeftBracket = 99

[

§

RightBracket = 100

]

§

Semicolon = 101

;

§

Comma = 102

,

§

Dot = 103

.

§

DotDotDot = 104

...

§

Colon = 105

:

§

Arrow = 106

=>

§

StringLiteral = 107

String literal

§

NumericLiteral = 108

Numeric literal

§

BigIntLiteral = 109

BigInt literal

§

RegexLiteral = 110

Regex literal

§

TemplateString = 111

Template string

§

TemplateHead = 112

Template head

§

TemplateMiddle = 113

Template middle

§

TemplateTail = 114

Template tail

§

IdentifierName = 115

Identifier

§

LineComment = 116

Line comment

§

BlockComment = 117

Block comment

§

Whitespace = 118

Whitespace

§

Newline = 119

Newline

§

Eof = 120

End of stream

§

Error = 121

Error token

Implementations§

Source§

impl JavaScriptTokenType

Source

pub fn is_keyword(&self) -> bool

Returns true if the token type is a keyword.

Source

pub fn from_keyword(s: &str) -> Option<Self>

Returns the token type for the given keyword string.

Source§

impl JavaScriptTokenType

Source

pub fn is_trivia(&self) -> bool

Returns true if the token type is a trivia (whitespace or comment).

Trait Implementations§

Source§

impl Clone for JavaScriptTokenType

Source§

fn clone(&self) -> JavaScriptTokenType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JavaScriptTokenType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for JavaScriptTokenType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<JavaScriptTokenType> for JavaScriptElementType

Source§

fn from(token: JavaScriptTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for JavaScriptTokenType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for JavaScriptTokenType

Source§

fn eq(&self, other: &JavaScriptTokenType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for JavaScriptTokenType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TokenType for JavaScriptTokenType

Source§

const END_OF_STREAM: Self = Self::Error

A constant representing the end of the input stream.
Source§

type Role = UniversalTokenRole

The associated role type for this token kind.
Source§

fn is_ignored(&self) -> bool

Returns true if this token represents trivia (whitespace, comments, etc.).
Source§

fn role(&self) -> Self::Role

Returns the general syntactic role of this token.
Source§

fn is_role(&self, role: Self::Role) -> bool

Returns true if this token matches the specified language-specific role.
Source§

fn is_universal(&self, role: UniversalTokenRole) -> bool

Returns true if this token matches the specified universal role.
Source§

fn is_comment(&self) -> bool

Returns true if this token represents a comment.
Source§

fn is_whitespace(&self) -> bool

Returns true if this token represents whitespace.
Source§

fn is_error(&self) -> bool

Returns true if this token represents an error condition.
Source§

fn is_end_of_stream(&self) -> bool

Returns true if this token represents the end of the input stream.
Source§

impl Copy for JavaScriptTokenType

Source§

impl Eq for JavaScriptTokenType

Source§

impl StructuralPartialEq for JavaScriptTokenType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,