Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[repr(u16)]
pub enum SyntaxKind {
Show 167 variants Unknown = 0, EndOfFileToken = 1, SingleLineCommentTrivia = 2, MultiLineCommentTrivia = 3, NewLineTrivia = 4, WhitespaceTrivia = 5, ShebangTrivia = 6, ConflictMarkerTrivia = 7, NonTextFileMarkerTrivia = 8, NumericLiteral = 9, BigIntLiteral = 10, StringLiteral = 11, JsxText = 12, JsxTextAllWhiteSpaces = 13, RegularExpressionLiteral = 14, NoSubstitutionTemplateLiteral = 15, TemplateHead = 16, TemplateMiddle = 17, TemplateTail = 18, OpenBraceToken = 19, CloseBraceToken = 20, OpenParenToken = 21, CloseParenToken = 22, OpenBracketToken = 23, CloseBracketToken = 24, DotToken = 25, DotDotDotToken = 26, SemicolonToken = 27, CommaToken = 28, QuestionDotToken = 29, LessThanToken = 30, LessThanSlashToken = 31, GreaterThanToken = 32, LessThanEqualsToken = 33, GreaterThanEqualsToken = 34, EqualsEqualsToken = 35, ExclamationEqualsToken = 36, EqualsEqualsEqualsToken = 37, ExclamationEqualsEqualsToken = 38, EqualsGreaterThanToken = 39, PlusToken = 40, MinusToken = 41, AsteriskToken = 42, AsteriskAsteriskToken = 43, SlashToken = 44, PercentToken = 45, PlusPlusToken = 46, MinusMinusToken = 47, LessThanLessThanToken = 48, GreaterThanGreaterThanToken = 49, GreaterThanGreaterThanGreaterThanToken = 50, AmpersandToken = 51, BarToken = 52, CaretToken = 53, ExclamationToken = 54, TildeToken = 55, AmpersandAmpersandToken = 56, BarBarToken = 57, QuestionToken = 58, ColonToken = 59, AtToken = 60, QuestionQuestionToken = 61, BacktickToken = 62, HashToken = 63, EqualsToken = 64, PlusEqualsToken = 65, MinusEqualsToken = 66, AsteriskEqualsToken = 67, AsteriskAsteriskEqualsToken = 68, SlashEqualsToken = 69, PercentEqualsToken = 70, LessThanLessThanEqualsToken = 71, GreaterThanGreaterThanEqualsToken = 72, GreaterThanGreaterThanGreaterThanEqualsToken = 73, AmpersandEqualsToken = 74, BarEqualsToken = 75, BarBarEqualsToken = 76, AmpersandAmpersandEqualsToken = 77, QuestionQuestionEqualsToken = 78, CaretEqualsToken = 79, Identifier = 80, PrivateIdentifier = 81, JSDocCommentTextToken = 82, BreakKeyword = 83, CaseKeyword = 84, CatchKeyword = 85, ClassKeyword = 86, ConstKeyword = 87, ContinueKeyword = 88, DebuggerKeyword = 89, DefaultKeyword = 90, DeleteKeyword = 91, DoKeyword = 92, ElseKeyword = 93, EnumKeyword = 94, ExportKeyword = 95, ExtendsKeyword = 96, FalseKeyword = 97, FinallyKeyword = 98, ForKeyword = 99, FunctionKeyword = 100, IfKeyword = 101, ImportKeyword = 102, InKeyword = 103, InstanceOfKeyword = 104, NewKeyword = 105, NullKeyword = 106, ReturnKeyword = 107, SuperKeyword = 108, SwitchKeyword = 109, ThisKeyword = 110, ThrowKeyword = 111, TrueKeyword = 112, TryKeyword = 113, TypeOfKeyword = 114, VarKeyword = 115, VoidKeyword = 116, WhileKeyword = 117, WithKeyword = 118, ImplementsKeyword = 119, InterfaceKeyword = 120, LetKeyword = 121, PackageKeyword = 122, PrivateKeyword = 123, ProtectedKeyword = 124, PublicKeyword = 125, StaticKeyword = 126, YieldKeyword = 127, AbstractKeyword = 128, AccessorKeyword = 129, AsKeyword = 130, AssertsKeyword = 131, AssertKeyword = 132, AnyKeyword = 133, AsyncKeyword = 134, AwaitKeyword = 135, BooleanKeyword = 136, ConstructorKeyword = 137, DeclareKeyword = 138, GetKeyword = 139, InferKeyword = 140, IntrinsicKeyword = 141, IsKeyword = 142, KeyOfKeyword = 143, ModuleKeyword = 144, NamespaceKeyword = 145, NeverKeyword = 146, OutKeyword = 147, ReadonlyKeyword = 148, RequireKeyword = 149, NumberKeyword = 150, ObjectKeyword = 151, SatisfiesKeyword = 152, SetKeyword = 153, StringKeyword = 154, SymbolKeyword = 155, TypeKeyword = 156, UndefinedKeyword = 157, UniqueKeyword = 158, UnknownKeyword = 159, UsingKeyword = 160, FromKeyword = 161, GlobalKeyword = 162, BigIntKeyword = 163, OverrideKeyword = 164, OfKeyword = 165, DeferKeyword = 166,
}
Expand description

Syntax kind enum matching TypeScript’s SyntaxKind. This enum contains only the token types produced by the scanner (0-186). AST node types are not included here.

Variants§

§

Unknown = 0

§

EndOfFileToken = 1

§

SingleLineCommentTrivia = 2

§

MultiLineCommentTrivia = 3

§

NewLineTrivia = 4

§

WhitespaceTrivia = 5

§

ShebangTrivia = 6

§

ConflictMarkerTrivia = 7

§

NonTextFileMarkerTrivia = 8

§

NumericLiteral = 9

§

BigIntLiteral = 10

§

StringLiteral = 11

§

JsxText = 12

§

JsxTextAllWhiteSpaces = 13

§

RegularExpressionLiteral = 14

§

NoSubstitutionTemplateLiteral = 15

§

TemplateHead = 16

§

TemplateMiddle = 17

§

TemplateTail = 18

§

OpenBraceToken = 19

§

CloseBraceToken = 20

§

OpenParenToken = 21

§

CloseParenToken = 22

§

OpenBracketToken = 23

§

CloseBracketToken = 24

§

DotToken = 25

§

DotDotDotToken = 26

§

SemicolonToken = 27

§

CommaToken = 28

§

QuestionDotToken = 29

§

LessThanToken = 30

§

LessThanSlashToken = 31

§

GreaterThanToken = 32

§

LessThanEqualsToken = 33

§

GreaterThanEqualsToken = 34

§

EqualsEqualsToken = 35

§

ExclamationEqualsToken = 36

§

EqualsEqualsEqualsToken = 37

§

ExclamationEqualsEqualsToken = 38

§

EqualsGreaterThanToken = 39

§

PlusToken = 40

§

MinusToken = 41

§

AsteriskToken = 42

§

AsteriskAsteriskToken = 43

§

SlashToken = 44

§

PercentToken = 45

§

PlusPlusToken = 46

§

MinusMinusToken = 47

§

LessThanLessThanToken = 48

§

GreaterThanGreaterThanToken = 49

§

GreaterThanGreaterThanGreaterThanToken = 50

§

AmpersandToken = 51

§

BarToken = 52

§

CaretToken = 53

§

ExclamationToken = 54

§

TildeToken = 55

§

AmpersandAmpersandToken = 56

§

BarBarToken = 57

§

QuestionToken = 58

§

ColonToken = 59

§

AtToken = 60

§

QuestionQuestionToken = 61

§

BacktickToken = 62

§

HashToken = 63

§

EqualsToken = 64

§

PlusEqualsToken = 65

§

MinusEqualsToken = 66

§

AsteriskEqualsToken = 67

§

AsteriskAsteriskEqualsToken = 68

§

SlashEqualsToken = 69

§

PercentEqualsToken = 70

§

LessThanLessThanEqualsToken = 71

§

GreaterThanGreaterThanEqualsToken = 72

§

GreaterThanGreaterThanGreaterThanEqualsToken = 73

§

AmpersandEqualsToken = 74

§

BarEqualsToken = 75

§

BarBarEqualsToken = 76

§

AmpersandAmpersandEqualsToken = 77

§

QuestionQuestionEqualsToken = 78

§

CaretEqualsToken = 79

§

Identifier = 80

§

PrivateIdentifier = 81

§

JSDocCommentTextToken = 82

§

BreakKeyword = 83

§

CaseKeyword = 84

§

CatchKeyword = 85

§

ClassKeyword = 86

§

ConstKeyword = 87

§

ContinueKeyword = 88

§

DebuggerKeyword = 89

§

DefaultKeyword = 90

§

DeleteKeyword = 91

§

DoKeyword = 92

§

ElseKeyword = 93

§

EnumKeyword = 94

§

ExportKeyword = 95

§

ExtendsKeyword = 96

§

FalseKeyword = 97

§

FinallyKeyword = 98

§

ForKeyword = 99

§

FunctionKeyword = 100

§

IfKeyword = 101

§

ImportKeyword = 102

§

InKeyword = 103

§

InstanceOfKeyword = 104

§

NewKeyword = 105

§

NullKeyword = 106

§

ReturnKeyword = 107

§

SuperKeyword = 108

§

SwitchKeyword = 109

§

ThisKeyword = 110

§

ThrowKeyword = 111

§

TrueKeyword = 112

§

TryKeyword = 113

§

TypeOfKeyword = 114

§

VarKeyword = 115

§

VoidKeyword = 116

§

WhileKeyword = 117

§

WithKeyword = 118

§

ImplementsKeyword = 119

§

InterfaceKeyword = 120

§

LetKeyword = 121

§

PackageKeyword = 122

§

PrivateKeyword = 123

§

ProtectedKeyword = 124

§

PublicKeyword = 125

§

StaticKeyword = 126

§

YieldKeyword = 127

§

AbstractKeyword = 128

§

AccessorKeyword = 129

§

AsKeyword = 130

§

AssertsKeyword = 131

§

AssertKeyword = 132

§

AnyKeyword = 133

§

AsyncKeyword = 134

§

AwaitKeyword = 135

§

BooleanKeyword = 136

§

ConstructorKeyword = 137

§

DeclareKeyword = 138

§

GetKeyword = 139

§

InferKeyword = 140

§

IntrinsicKeyword = 141

§

IsKeyword = 142

§

KeyOfKeyword = 143

§

ModuleKeyword = 144

§

NamespaceKeyword = 145

§

NeverKeyword = 146

§

OutKeyword = 147

§

ReadonlyKeyword = 148

§

RequireKeyword = 149

§

NumberKeyword = 150

§

ObjectKeyword = 151

§

SatisfiesKeyword = 152

§

SetKeyword = 153

§

StringKeyword = 154

§

SymbolKeyword = 155

§

TypeKeyword = 156

§

UndefinedKeyword = 157

§

UniqueKeyword = 158

§

UnknownKeyword = 159

§

UsingKeyword = 160

§

FromKeyword = 161

§

GlobalKeyword = 162

§

BigIntKeyword = 163

§

OverrideKeyword = 164

§

OfKeyword = 165

§

DeferKeyword = 166

Implementations§

Source§

impl SyntaxKind

Source

pub const FIRST_TOKEN: SyntaxKind = Self::Unknown

Source

pub const LAST_TOKEN: SyntaxKind = Self::DeferKeyword

Source

pub const FIRST_KEYWORD: SyntaxKind = Self::BreakKeyword

Source

pub const LAST_KEYWORD: SyntaxKind = Self::DeferKeyword

Source

pub const FIRST_PUNCTUATION: SyntaxKind = Self::OpenBraceToken

Source

pub const LAST_PUNCTUATION: SyntaxKind = Self::CaretEqualsToken

Source

pub const FIRST_LITERAL_TOKEN: SyntaxKind = Self::NumericLiteral

Source

pub const LAST_LITERAL_TOKEN: SyntaxKind = Self::NoSubstitutionTemplateLiteral

Source

pub const FIRST_TEMPLATE_TOKEN: SyntaxKind = Self::NoSubstitutionTemplateLiteral

Source

pub const LAST_TEMPLATE_TOKEN: SyntaxKind = Self::TemplateTail

Source

pub const FIRST_RESERVED_WORD: SyntaxKind = Self::BreakKeyword

Source

pub const LAST_RESERVED_WORD: SyntaxKind = Self::WithKeyword

Source

pub const FIRST_FUTURE_RESERVED_WORD: SyntaxKind = Self::ImplementsKeyword

Source

pub const LAST_FUTURE_RESERVED_WORD: SyntaxKind = Self::YieldKeyword

Source

pub fn try_from_u16(value: u16) -> Option<SyntaxKind>

Safely convert a u16 to SyntaxKind if it’s a valid token kind. Returns None for extended syntax kinds (AST nodes > 166).

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> SyntaxKind

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 SyntaxKind

Source§

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

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

impl From<SyntaxKind> for JsValue

Source§

fn from(value: SyntaxKind) -> JsValue

Converts to this type from the input type.
Source§

impl FromWasmAbi for SyntaxKind

Source§

type Abi = u32

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: u32) -> SyntaxKind

Recover a Self from Self::Abi. Read more
Source§

impl Hash for SyntaxKind

Source§

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

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 IntoWasmAbi for SyntaxKind

Source§

type Abi = u32

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> u32

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl OptionFromWasmAbi for SyntaxKind

Source§

fn is_none(val: &<SyntaxKind as FromWasmAbi>::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for SyntaxKind

Source§

fn none() -> <SyntaxKind as IntoWasmAbi>::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl PartialEq for SyntaxKind

Source§

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

Source§

fn partial_cmp(&self, other: &SyntaxKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for SyntaxKind

Source§

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

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

impl TryFromJsValue for SyntaxKind

Source§

fn try_from_js_value_ref(value: &JsValue) -> Option<SyntaxKind>

Performs the conversion.
Source§

fn try_from_js_value(value: JsValue) -> Result<Self, JsValue>

Performs the conversion.
Source§

impl VectorFromWasmAbi for SyntaxKind

Source§

impl VectorIntoWasmAbi for SyntaxKind

Source§

impl Copy for SyntaxKind

Source§

impl Eq for SyntaxKind

Source§

impl StructuralPartialEq for SyntaxKind

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more