#[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
impl SyntaxKind
pub const FIRST_TOKEN: SyntaxKind = Self::Unknown
pub const LAST_TOKEN: SyntaxKind = Self::DeferKeyword
pub const FIRST_KEYWORD: SyntaxKind = Self::BreakKeyword
pub const LAST_KEYWORD: SyntaxKind = Self::DeferKeyword
pub const FIRST_PUNCTUATION: SyntaxKind = Self::OpenBraceToken
pub const LAST_PUNCTUATION: SyntaxKind = Self::CaretEqualsToken
pub const FIRST_LITERAL_TOKEN: SyntaxKind = Self::NumericLiteral
pub const LAST_LITERAL_TOKEN: SyntaxKind = Self::NoSubstitutionTemplateLiteral
pub const FIRST_TEMPLATE_TOKEN: SyntaxKind = Self::NoSubstitutionTemplateLiteral
pub const LAST_TEMPLATE_TOKEN: SyntaxKind = Self::TemplateTail
pub const FIRST_RESERVED_WORD: SyntaxKind = Self::BreakKeyword
pub const LAST_RESERVED_WORD: SyntaxKind = Self::WithKeyword
pub const FIRST_FUTURE_RESERVED_WORD: SyntaxKind = Self::ImplementsKeyword
pub const LAST_FUTURE_RESERVED_WORD: SyntaxKind = Self::YieldKeyword
Sourcepub fn try_from_u16(value: u16) -> Option<SyntaxKind>
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
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyntaxKind
impl Debug for SyntaxKind
Source§impl From<SyntaxKind> for JsValue
impl From<SyntaxKind> for JsValue
Source§fn from(value: SyntaxKind) -> JsValue
fn from(value: SyntaxKind) -> JsValue
Converts to this type from the input type.
Source§impl FromWasmAbi for SyntaxKind
impl FromWasmAbi for SyntaxKind
Source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
Source§impl IntoWasmAbi for SyntaxKind
impl IntoWasmAbi for SyntaxKind
Source§impl OptionFromWasmAbi for SyntaxKind
impl OptionFromWasmAbi for SyntaxKind
Source§fn is_none(val: &<SyntaxKind as FromWasmAbi>::Abi) -> bool
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
impl OptionIntoWasmAbi for SyntaxKind
Source§fn none() -> <SyntaxKind as IntoWasmAbi>::Abi
fn none() -> <SyntaxKind as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None branch of this option. Read moreSource§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
Source§impl PartialOrd for SyntaxKind
impl PartialOrd for SyntaxKind
Source§impl Serialize for SyntaxKind
impl Serialize for SyntaxKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl TryFromJsValue for SyntaxKind
Source§fn try_from_js_value_ref(value: &JsValue) -> Option<SyntaxKind>
fn try_from_js_value_ref(value: &JsValue) -> Option<SyntaxKind>
Performs the conversion.
Source§impl VectorFromWasmAbi for SyntaxKind
impl VectorFromWasmAbi for SyntaxKind
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <SyntaxKind as VectorFromWasmAbi>::Abi, ) -> Box<[SyntaxKind]>
Source§impl VectorIntoWasmAbi for SyntaxKind
impl VectorIntoWasmAbi for SyntaxKind
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[SyntaxKind]>, ) -> <SyntaxKind as VectorIntoWasmAbi>::Abi
impl Copy for SyntaxKind
impl Eq for SyntaxKind
impl StructuralPartialEq for SyntaxKind
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnsafeUnpin for SyntaxKind
impl UnwindSafe for SyntaxKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
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.