Skip to main content

TypeScriptTokenType

Enum TypeScriptTokenType 

Source
#[repr(u16)]
pub enum TypeScriptTokenType {
Show 244 variants NamedImports = 0, Decorator = 1, ArrowFunction = 2, PredefinedType = 3, Abstract = 4, Any = 5, As = 6, Asserts = 7, Async = 8, Await = 9, Boolean = 10, Break = 11, Case = 12, Catch = 13, Class = 14, Const = 15, Constructor = 16, Continue = 17, Debugger = 18, Declare = 19, Default = 20, Delete = 21, Do = 22, Else = 23, Enum = 24, Export = 25, Extends = 26, False = 27, Finally = 28, For = 29, From = 30, Function = 31, Get = 32, Global = 33, If = 34, Implements = 35, Import = 36, In = 37, Infer = 38, Instanceof = 39, Interface = 40, Is = 41, Keyof = 42, Let = 43, Namespace = 44, Never = 45, New = 46, Null = 47, Number = 48, Object = 49, Of = 50, Override = 51, Package = 52, Private = 53, Protected = 54, Public = 55, Readonly = 56, Require = 57, Return = 58, Set = 59, Static = 60, String = 61, Super = 62, Switch = 63, Symbol = 64, This = 65, Throw = 66, True = 67, Try = 68, Type = 69, Typeof = 70, Undefined = 71, Unique = 72, Unknown = 73, Var = 74, Void = 75, While = 76, With = 77, Yield = 78, Plus = 79, Minus = 80, Star = 81, Slash = 82, Percent = 83, StarStar = 84, Question = 85, DotDotDot = 86, Less = 87, Greater = 88, LessEqual = 89, GreaterEqual = 90, EqualEqual = 91, NotEqual = 92, EqualEqualEqual = 93, NotEqualEqual = 94, AmpersandAmpersand = 95, PipePipe = 96, Exclamation = 97, Ampersand = 98, Pipe = 99, Caret = 100, Tilde = 101, LeftShift = 102, RightShift = 103, UnsignedRightShift = 104, Equal = 105, PlusEqual = 106, MinusEqual = 107, StarEqual = 108, SlashEqual = 109, PercentEqual = 110, StarStarEqual = 111, LeftShiftEqual = 112, RightShiftEqual = 113, UnsignedRightShiftEqual = 114, AmpersandEqual = 115, PipeEqual = 116, CaretEqual = 117, AmpersandAmpersandEqual = 118, PipePipeEqual = 119, QuestionQuestionEqual = 120, PlusPlus = 121, MinusMinus = 122, QuestionQuestion = 123, QuestionDot = 124, Arrow = 125, LeftParen = 126, RightParen = 127, LeftBrace = 128, RightBrace = 129, LeftBracket = 130, RightBracket = 131, Semicolon = 132, Comma = 133, Dot = 134, Colon = 135, At = 136, StringLiteral = 137, NumericLiteral = 138, BigIntLiteral = 139, BooleanLiteral = 140, TemplateString = 141, RegexLiteral = 142, IdentifierName = 143, LineComment = 144, BlockComment = 145, Whitespace = 146, Newline = 147, Eof = 148, Root = 149, SourceFile = 150, Module = 151, VariableDeclaration = 152, FunctionDeclaration = 153, ClassDeclaration = 154, InterfaceDeclaration = 155, TypeAliasDeclaration = 156, EnumDeclaration = 157, NamespaceDeclaration = 158, ClassBody = 159, ImportDeclaration = 160, ExportDeclaration = 161, ImportClause = 162, ImportSpecifier = 163, Parameter = 164, CallArgument = 165, PropertyDeclaration = 166, MethodDeclaration = 167, ConstructorDeclaration = 168, PropertyAssignment = 169, ShorthandPropertyAssignment = 170, SpreadElement = 171, Error = 172, JsxElement = 173, JsxSelfClosingElement = 174, JsxOpeningElement = 175, JsxClosingElement = 176, JsxFragment = 177, JsxOpeningFragment = 178, JsxClosingFragment = 179, JsxAttribute = 180, JsxAttributes = 181, JsxExpressionContainer = 182, JsxSpreadAttribute = 183, JsxText = 184, BinaryExpression = 185, UnaryExpression = 186, ConditionalExpression = 187, CallExpression = 188, NewExpression = 189, MemberExpression = 190, ArrayExpression = 191, ObjectExpression = 192, FunctionExpression = 193, TemplateExpression = 194, TaggedTemplateExpression = 195, AsExpression = 196, TypeAssertionExpression = 197, NonNullExpression = 198, UpdateExpression = 199, ExpressionStatement = 200, BlockStatement = 201, IfStatement = 202, WhileStatement = 203, ForStatement = 204, ForInStatement = 205, ForOfStatement = 206, DoWhileStatement = 207, SwitchStatement = 208, CaseClause = 209, DefaultClause = 210, TryStatement = 211, CatchClause = 212, FinallyClause = 213, ThrowStatement = 214, ReturnStatement = 215, BreakStatement = 216, ContinueStatement = 217, DebuggerStatement = 218, WithStatement = 219, BindingPattern = 220, ArrayBindingPattern = 221, ObjectBindingPattern = 222, BindingElement = 223, TypeReference = 224, TypeLiteral = 225, FunctionType = 226, ConstructorType = 227, ArrayType = 228, TupleType = 229, UnionType = 230, IntersectionType = 231, ConditionalType = 232, MappedType = 233, IndexedAccessType = 234, PropertySignature = 235, MethodSignature = 236, LiteralType = 237, TypeQuery = 238, TypePredicate = 239, TypeAnnotation = 240, TypeParameter = 241, HeritageClause = 242, EnumMember = 243,
}
Expand description

Token types for TypeScript.

Variants§

§

NamedImports = 0

Named imports.

§

Decorator = 1

A decorator.

§

ArrowFunction = 2

Arrow function =>.

§

PredefinedType = 3

Predefined type.

§

Abstract = 4

abstract keyword.

§

Any = 5

any keyword.

§

As = 6

as keyword.

§

Asserts = 7

asserts keyword.

§

Async = 8

async keyword.

§

Await = 9

await keyword.

§

Boolean = 10

boolean keyword.

§

Break = 11

break keyword.

§

Case = 12

case keyword.

§

Catch = 13

catch keyword.

§

Class = 14

class keyword.

§

Const = 15

const keyword.

§

Constructor = 16

constructor keyword.

§

Continue = 17

continue keyword.

§

Debugger = 18

debugger keyword.

§

Declare = 19

declare keyword.

§

Default = 20

default keyword.

§

Delete = 21

delete keyword.

§

Do = 22

do keyword.

§

Else = 23

else keyword.

§

Enum = 24

enum keyword.

§

Export = 25

export keyword.

§

Extends = 26

extends keyword.

§

False = 27

false keyword.

§

Finally = 28

finally keyword.

§

For = 29

for keyword.

§

From = 30

from keyword.

§

Function = 31

function keyword.

§

Get = 32

get keyword.

§

Global = 33

global keyword.

§

If = 34

if keyword.

§

Implements = 35

implements keyword.

§

Import = 36

import keyword.

§

In = 37

in keyword.

§

Infer = 38

infer keyword.

§

Instanceof = 39

instanceof keyword.

§

Interface = 40

interface keyword.

§

Is = 41

is keyword.

§

Keyof = 42

keyof keyword.

§

Let = 43

let keyword.

§

Namespace = 44

namespace keyword.

§

Never = 45

never keyword.

§

New = 46

new keyword.

§

Null = 47

null keyword.

§

Number = 48

number keyword.

§

Object = 49

object keyword.

§

Of = 50

of keyword.

§

Override = 51

override keyword.

§

Package = 52

package keyword.

§

Private = 53

private keyword.

§

Protected = 54

protected keyword.

§

Public = 55

public keyword.

§

Readonly = 56

readonly keyword.

§

Require = 57

require keyword.

§

Return = 58

return keyword.

§

Set = 59

set keyword.

§

Static = 60

static keyword.

§

String = 61

string keyword.

§

Super = 62

super keyword.

§

Switch = 63

switch keyword.

§

Symbol = 64

symbol keyword.

§

This = 65

this keyword.

§

Throw = 66

throw keyword.

§

True = 67

true keyword.

§

Try = 68

try keyword.

§

Type = 69

type keyword.

§

Typeof = 70

typeof keyword.

§

Undefined = 71

undefined keyword.

§

Unique = 72

unique keyword.

§

Unknown = 73

unknown keyword.

§

Var = 74

var keyword.

§

Void = 75

void keyword.

§

While = 76

while keyword.

§

With = 77

with keyword.

§

Yield = 78

yield keyword.

§

Plus = 79

Plus +.

§

Minus = 80

Minus -.

§

Star = 81

Star *.

§

Slash = 82

Slash /.

§

Percent = 83

Percent %.

§

StarStar = 84

StarStar **.

§

Question = 85

Question ?.

§

DotDotDot = 86

DotDotDot ....

§

Less = 87

Less <.

§

Greater = 88

Greater >.

§

LessEqual = 89

LessEqual <=.

§

GreaterEqual = 90

Greater than or equal >=.

§

EqualEqual = 91

Equal ==.

§

NotEqual = 92

Not equal !=.

§

EqualEqualEqual = 93

Strict equal ===.

§

NotEqualEqual = 94

Strict not equal !==.

§

AmpersandAmpersand = 95

Logical AND &&.

§

PipePipe = 96

Logical OR ||.

§

Exclamation = 97

Logical NOT !.

§

Ampersand = 98

Bitwise AND &.

§

Pipe = 99

Bitwise OR |.

§

Caret = 100

Bitwise XOR ^.

§

Tilde = 101

Bitwise NOT ~.

§

LeftShift = 102

Left shift <<.

§

RightShift = 103

Right shift >>.

§

UnsignedRightShift = 104

Unsigned right shift >>>.

§

Equal = 105

Assignment =.

§

PlusEqual = 106

Addition assignment +=.

§

MinusEqual = 107

Subtraction assignment -=.

§

StarEqual = 108

Multiplication assignment *=.

§

SlashEqual = 109

Division assignment /=.

§

PercentEqual = 110

Remainder assignment %=.

§

StarStarEqual = 111

Exponentiation assignment **=.

§

LeftShiftEqual = 112

Left shift assignment <<=.

§

RightShiftEqual = 113

Right shift assignment >>=.

§

UnsignedRightShiftEqual = 114

Unsigned right shift assignment >>>=.

§

AmpersandEqual = 115

Bitwise AND assignment &=.

§

PipeEqual = 116

Bitwise OR assignment |=.

§

CaretEqual = 117

Bitwise XOR assignment ^=.

§

AmpersandAmpersandEqual = 118

Logical AND assignment &&=.

§

PipePipeEqual = 119

Logical OR assignment ||=.

§

QuestionQuestionEqual = 120

Nullish coalescing assignment ??=.

§

PlusPlus = 121

Increment ++.

§

MinusMinus = 122

Decrement --.

§

QuestionQuestion = 123

Nullish coalescing ??.

§

QuestionDot = 124

Optional chaining ?..

§

Arrow = 125

Arrow =>.

§

LeftParen = 126

Left parenthesis (.

§

RightParen = 127

Right parenthesis ).

§

LeftBrace = 128

Left brace {.

§

RightBrace = 129

Right brace }.

§

LeftBracket = 130

Left bracket [.

§

RightBracket = 131

Right bracket ].

§

Semicolon = 132

Semicolon ;.

§

Comma = 133

Comma ,.

§

Dot = 134

Dot ..

§

Colon = 135

Colon :.

§

At = 136

At @.

§

StringLiteral = 137

String literal.

§

NumericLiteral = 138

Numeric literal.

§

BigIntLiteral = 139

BigInt literal.

§

BooleanLiteral = 140

Boolean literal.

§

TemplateString = 141

Template string.

§

RegexLiteral = 142

Regular expression literal.

§

IdentifierName = 143

Identifier name.

§

LineComment = 144

Line comment //.

§

BlockComment = 145

Block comment /* */.

§

Whitespace = 146

Whitespace.

§

Newline = 147

Newline.

§

Eof = 148

End of stream.

§

Root = 149

Root node.

§

SourceFile = 150

Source file.

§

Module = 151

Module.

§

VariableDeclaration = 152

Variable declaration.

§

FunctionDeclaration = 153

Function declaration.

§

ClassDeclaration = 154

Class declaration.

§

InterfaceDeclaration = 155

Interface declaration.

§

TypeAliasDeclaration = 156

Type alias declaration.

§

EnumDeclaration = 157

Enum declaration.

§

NamespaceDeclaration = 158

Namespace declaration.

§

ClassBody = 159

Class body.

§

ImportDeclaration = 160

Import declaration.

§

ExportDeclaration = 161

Export declaration.

§

ImportClause = 162

Import clause.

§

ImportSpecifier = 163

Import specifier.

§

Parameter = 164

Parameter.

§

CallArgument = 165

Call argument.

§

PropertyDeclaration = 166

Property declaration.

§

MethodDeclaration = 167

Method declaration.

§

ConstructorDeclaration = 168

Constructor declaration.

§

PropertyAssignment = 169

Property assignment.

§

ShorthandPropertyAssignment = 170

Shorthand property assignment.

§

SpreadElement = 171

Spread element.

§

Error = 172

Error token.

§

JsxElement = 173

JSX element.

§

JsxSelfClosingElement = 174

JSX self-closing element.

§

JsxOpeningElement = 175

JSX opening element.

§

JsxClosingElement = 176

JSX closing element.

§

JsxFragment = 177

JSX fragment.

§

JsxOpeningFragment = 178

JSX opening fragment.

§

JsxClosingFragment = 179

JSX closing fragment.

§

JsxAttribute = 180

JSX attribute.

§

JsxAttributes = 181

JSX attributes.

§

JsxExpressionContainer = 182

JSX expression container.

§

JsxSpreadAttribute = 183

JSX spread attribute.

§

JsxText = 184

JSX text.

§

BinaryExpression = 185

Binary expression.

§

UnaryExpression = 186

Unary expression.

§

ConditionalExpression = 187

Conditional expression a ? b : c.

§

CallExpression = 188

Call expression f().

§

NewExpression = 189

New expression new C().

§

MemberExpression = 190

Member expression a.b or a[b].

§

ArrayExpression = 191

Array expression [a, b].

§

ObjectExpression = 192

Object expression {a: b}.

§

FunctionExpression = 193

Function expression function() {}.

§

TemplateExpression = 194

Template expression `...`.

§

TaggedTemplateExpression = 195

Tagged template expression f ... ``.

§

AsExpression = 196

As expression a as T.

§

TypeAssertionExpression = 197

Type assertion expression <T>a.

§

NonNullExpression = 198

Non-null expression a!.

§

UpdateExpression = 199

Update expression ++a or a--.

§

ExpressionStatement = 200

Expression statement.

§

BlockStatement = 201

Block statement.

§

IfStatement = 202

If statement.

§

WhileStatement = 203

While statement.

§

ForStatement = 204

For statement.

§

ForInStatement = 205

For-in statement.

§

ForOfStatement = 206

For-of statement.

§

DoWhileStatement = 207

Do-while statement.

§

SwitchStatement = 208

Switch statement.

§

CaseClause = 209

Case clause.

§

DefaultClause = 210

Default clause.

§

TryStatement = 211

Try statement.

§

CatchClause = 212

Catch clause.

§

FinallyClause = 213

Finally clause.

§

ThrowStatement = 214

Throw statement.

§

ReturnStatement = 215

Return statement.

§

BreakStatement = 216

Break statement.

§

ContinueStatement = 217

Continue statement.

§

DebuggerStatement = 218

Debugger statement.

§

WithStatement = 219

With statement.

§

BindingPattern = 220

Binding pattern.

§

ArrayBindingPattern = 221

Array binding pattern.

§

ObjectBindingPattern = 222

Object binding pattern.

§

BindingElement = 223

Binding element.

§

TypeReference = 224

Type reference.

§

TypeLiteral = 225

Type literal.

§

FunctionType = 226

Function type.

§

ConstructorType = 227

Constructor type.

§

ArrayType = 228

Array type.

§

TupleType = 229

Tuple type.

§

UnionType = 230

Union type.

§

IntersectionType = 231

Intersection type.

§

ConditionalType = 232

Conditional type.

§

MappedType = 233

Mapped type.

§

IndexedAccessType = 234

Indexed access type.

§

PropertySignature = 235

Property signature.

§

MethodSignature = 236

Method signature.

§

LiteralType = 237

Literal type.

§

TypeQuery = 238

Type query.

§

TypePredicate = 239

Type predicate.

§

TypeAnnotation = 240

Type annotation.

§

TypeParameter = 241

Type parameter.

§

HeritageClause = 242

Heritage clause.

§

EnumMember = 243

Enum member.

Implementations§

Source§

impl TypeScriptTokenType

Source

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

Returns the keyword token type for the given text, if any.

Trait Implementations§

Source§

impl Clone for TypeScriptTokenType

Source§

fn clone(&self) -> TypeScriptTokenType

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 TypeScriptTokenType

Source§

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

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

impl<'de> Deserialize<'de> for TypeScriptTokenType

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<TypeScriptTokenType> for TypeScriptElementType

Source§

fn from(token: TypeScriptTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for TypeScriptTokenType

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 TypeScriptTokenType

Source§

fn eq(&self, other: &TypeScriptTokenType) -> 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 TypeScriptTokenType

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 TypeScriptTokenType

Source§

const END_OF_STREAM: Self = Self::Eof

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 TypeScriptTokenType

Source§

impl Eq for TypeScriptTokenType

Source§

impl StructuralPartialEq for TypeScriptTokenType

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>,