use num_derive::FromPrimitive;
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Typescript {
End = 0,
Identifier = 1,
HashBangLine = 2,
Export = 3,
STAR = 4,
Default = 5,
Type = 6,
EQ = 7,
As = 8,
Namespace = 9,
LBRACE = 10,
COMMA = 11,
RBRACE = 12,
Typeof = 13,
Import2 = 14,
From = 15,
Var = 16,
Let = 17,
Const = 18,
BANG = 19,
Else = 20,
If = 21,
Switch = 22,
For = 23,
LPAREN = 24,
RPAREN = 25,
Await = 26,
In = 27,
Of = 28,
While = 29,
Do = 30,
Try = 31,
With = 32,
Break = 33,
Continue = 34,
Debugger = 35,
Return = 36,
Throw = 37,
SEMI = 38,
COLON = 39,
Case = 40,
Catch = 41,
Finally = 42,
Yield = 43,
LBRACK = 44,
RBRACK = 45,
LT = 46,
GT = 47,
SLASH = 48,
DOT = 49,
Class2 = 50,
Async = 51,
Function2 = 52,
EQGT = 53,
QMARKDOT = 54,
New = 55,
PLUSEQ = 56,
DASHEQ = 57,
STAREQ = 58,
SLASHEQ = 59,
PERCENTEQ = 60,
CARETEQ = 61,
AMPEQ = 62,
PIPEEQ = 63,
GTGTEQ = 64,
GTGTGTEQ = 65,
LTLTEQ = 66,
STARSTAREQ = 67,
AMPAMPEQ = 68,
PIPEPIPEEQ = 69,
QMARKQMARKEQ = 70,
DOTDOTDOT = 71,
AMPAMP = 72,
PIPEPIPE = 73,
GTGT = 74,
GTGTGT = 75,
LTLT = 76,
AMP = 77,
CARET = 78,
PIPE = 79,
PLUS = 80,
DASH = 81,
PERCENT = 82,
STARSTAR = 83,
LTEQ = 84,
EQEQ = 85,
EQEQEQ = 86,
BANGEQ = 87,
BANGEQEQ = 88,
GTEQ = 89,
QMARKQMARK = 90,
Instanceof = 91,
TILDE = 92,
Void = 93,
Delete = 94,
PLUSPLUS = 95,
DASHDASH = 96,
DQUOTE = 97,
SQUOTE = 98,
StringFragment = 99,
StringFragment2 = 100,
EscapeSequence = 101,
Comment = 102,
BQUOTE = 103,
DOLLARLBRACE = 104,
SLASH2 = 105,
RegexPattern = 106,
RegexFlags = 107,
Number = 108,
PrivatePropertyIdentifier = 109,
Target = 110,
This = 111,
Super = 112,
True = 113,
False = 114,
Null = 115,
Undefined = 116,
AT = 117,
Static = 118,
Readonly = 119,
Get = 120,
Set = 121,
QMARK = 122,
Declare = 123,
Public = 124,
Private = 125,
Protected = 126,
Override = 127,
Module2 = 128,
Any = 129,
Number2 = 130,
Boolean = 131,
String2 = 132,
Symbol = 133,
Abstract = 134,
Require = 135,
Extends = 136,
Implements = 137,
Global = 138,
Interface = 139,
Enum = 140,
DASHQMARKCOLON = 141,
QMARKCOLON = 142,
Asserts2 = 143,
Infer = 144,
Is = 145,
Keyof = 146,
Unknown = 147,
Never = 148,
Object2 = 149,
LBRACEPIPE = 150,
PIPERBRACE = 151,
AutomaticSemicolon = 152,
TemplateChars = 153,
QMARK2 = 154,
FunctionSignatureAutomaticSemicolon = 155,
Program = 156,
ExportStatement = 157,
ExportClause = 158,
ExportSpecifier = 159,
Declaration = 160,
Import = 161,
ImportStatement = 162,
ImportClause = 163,
FromClause = 164,
NamespaceImport = 165,
NamedImports = 166,
ExpressionStatement = 167,
VariableDeclaration = 168,
LexicalDeclaration = 169,
VariableDeclarator = 170,
StatementBlock = 171,
ElseClause = 172,
IfStatement = 173,
SwitchStatement = 174,
ForStatement = 175,
ForInStatement = 176,
ForHeader = 177,
WhileStatement = 178,
DoStatement = 179,
TryStatement = 180,
WithStatement = 181,
BreakStatement = 182,
ContinueStatement = 183,
DebuggerStatement = 184,
ReturnStatement = 185,
ThrowStatement = 186,
EmptyStatement = 187,
LabeledStatement = 188,
SwitchBody = 189,
SwitchCase = 190,
SwitchDefault = 191,
CatchClause = 192,
FinallyClause = 193,
ParenthesizedExpression = 194,
Expression = 195,
PrimaryExpression = 196,
YieldExpression = 197,
Object = 198,
ObjectPattern = 199,
AssignmentPattern = 200,
ObjectAssignmentPattern = 201,
Array = 202,
ArrayPattern = 203,
NestedIdentifier = 204,
Class = 205,
ClassDeclaration = 206,
ClassHeritage = 207,
Function = 208,
FunctionDeclaration = 209,
GeneratorFunction = 210,
GeneratorFunctionDeclaration = 211,
ArrowFunction = 212,
CallSignature2 = 213,
FormalParameter = 214,
CallExpression = 215,
NewExpression = 216,
AwaitExpression = 217,
MemberExpression = 218,
SubscriptExpression = 219,
AssignmentExpression = 220,
AugmentedAssignmentLhs = 221,
AugmentedAssignmentExpression = 222,
Initializer = 223,
DestructuringPattern = 224,
SpreadElement = 225,
TernaryExpression = 226,
BinaryExpression = 227,
UnaryExpression = 228,
UpdateExpression = 229,
SequenceExpression = 230,
String = 231,
TemplateString = 232,
TemplateSubstitution = 233,
Regex = 234,
MetaProperty = 235,
Arguments = 236,
Decorator = 237,
MemberExpression2 = 238,
CallExpression2 = 239,
ClassBody = 240,
FormalParameters = 241,
Pattern = 242,
RestPattern = 243,
MethodDefinition = 244,
Pair = 245,
PairPattern = 246,
PropertyName = 247,
ComputedPropertyName = 248,
PublicFieldDefinition = 249,
NonNullExpression = 250,
MethodSignature = 251,
AbstractMethodSignature = 252,
FunctionSignature = 253,
TypeAssertion = 254,
AsExpression = 255,
ImportRequireClause = 256,
ExtendsClause = 257,
ImplementsClause = 258,
AmbientDeclaration = 259,
AbstractClassDeclaration = 260,
Module = 261,
InternalModule = 262,
Module3 = 263,
ImportAlias = 264,
NestedTypeIdentifier = 265,
InterfaceDeclaration = 266,
ExtendsTypeClause = 267,
EnumDeclaration = 268,
EnumBody = 269,
EnumAssignment = 270,
TypeAliasDeclaration = 271,
AccessibilityModifier = 272,
OverrideModifier = 273,
RequiredParameter = 274,
OptionalParameter = 275,
ParameterName = 276,
OmittingTypeAnnotation = 277,
OptingTypeAnnotation = 278,
TypeAnnotation = 279,
Asserts = 280,
Type2 = 281,
RequiredParameter2 = 282,
OptionalParameter2 = 283,
OptionalType = 284,
RestType = 285,
TupleTypeMember = 286,
ConstructorType = 287,
PrimaryType = 288,
TemplateType = 289,
TemplateLiteralType = 290,
InferType = 291,
ConditionalType = 292,
GenericType = 293,
TypePredicate = 294,
TypePredicateAnnotation = 295,
MemberExpression3 = 296,
SubscriptExpression2 = 297,
CallExpression3 = 298,
TypeQuery = 299,
IndexTypeQuery = 300,
LookupType = 301,
MappedTypeClause = 302,
LiteralType = 303,
UnaryExpression2 = 304,
ExistentialType = 305,
FlowMaybeType = 306,
ParenthesizedType = 307,
PredefinedType = 308,
TypeArguments = 309,
ObjectType = 310,
CallSignature = 311,
PropertySignature = 312,
TypeParameters = 313,
TypeParameter = 314,
DefaultType = 315,
Constraint = 316,
ConstructSignature = 317,
IndexSignature = 318,
ArrayType = 319,
TupleType = 320,
ReadonlyType = 321,
UnionType = 322,
IntersectionType = 323,
FunctionType = 324,
ProgramRepeat1 = 325,
ExportStatementRepeat1 = 326,
ExportClauseRepeat1 = 327,
NamedImportsRepeat1 = 328,
VariableDeclarationRepeat1 = 329,
SwitchBodyRepeat1 = 330,
ObjectRepeat1 = 331,
ObjectPatternRepeat1 = 332,
ArrayRepeat1 = 333,
ArrayPatternRepeat1 = 334,
StringRepeat1 = 335,
StringRepeat2 = 336,
TemplateStringRepeat1 = 337,
ClassBodyRepeat1 = 338,
FormalParametersRepeat1 = 339,
ExtendsClauseRepeat1 = 340,
ImplementsClauseRepeat1 = 341,
ExtendsTypeClauseRepeat1 = 342,
EnumBodyRepeat1 = 343,
TemplateLiteralTypeRepeat1 = 344,
ObjectTypeRepeat1 = 345,
TypeParametersRepeat1 = 346,
TupleTypeRepeat1 = 347,
ImportSpecifier = 348,
NamespaceExport = 349,
PropertyIdentifier = 350,
ShorthandPropertyIdentifier = 351,
ShorthandPropertyIdentifierPattern = 352,
StatementIdentifier = 353,
ThisType = 354,
TypeIdentifier = 355,
Error = 356,
}
impl From<Typescript> for &'static str {
#[inline(always)]
fn from(tok: Typescript) -> Self {
match tok {
Typescript::End => "end",
Typescript::Identifier => "identifier",
Typescript::HashBangLine => "hash_bang_line",
Typescript::Export => "export",
Typescript::STAR => "*",
Typescript::Default => "default",
Typescript::Type => "type",
Typescript::EQ => "=",
Typescript::As => "as",
Typescript::Namespace => "namespace",
Typescript::LBRACE => "{",
Typescript::COMMA => ",",
Typescript::RBRACE => "}",
Typescript::Typeof => "typeof",
Typescript::Import2 => "import",
Typescript::From => "from",
Typescript::Var => "var",
Typescript::Let => "let",
Typescript::Const => "const",
Typescript::BANG => "!",
Typescript::Else => "else",
Typescript::If => "if",
Typescript::Switch => "switch",
Typescript::For => "for",
Typescript::LPAREN => "(",
Typescript::RPAREN => ")",
Typescript::Await => "await",
Typescript::In => "in",
Typescript::Of => "of",
Typescript::While => "while",
Typescript::Do => "do",
Typescript::Try => "try",
Typescript::With => "with",
Typescript::Break => "break",
Typescript::Continue => "continue",
Typescript::Debugger => "debugger",
Typescript::Return => "return",
Typescript::Throw => "throw",
Typescript::SEMI => ";",
Typescript::COLON => ":",
Typescript::Case => "case",
Typescript::Catch => "catch",
Typescript::Finally => "finally",
Typescript::Yield => "yield",
Typescript::LBRACK => "[",
Typescript::RBRACK => "]",
Typescript::LT => "<",
Typescript::GT => ">",
Typescript::SLASH => "/",
Typescript::DOT => ".",
Typescript::Class2 => "class",
Typescript::Async => "async",
Typescript::Function2 => "function",
Typescript::EQGT => "=>",
Typescript::QMARKDOT => "?.",
Typescript::New => "new",
Typescript::PLUSEQ => "+=",
Typescript::DASHEQ => "-=",
Typescript::STAREQ => "*=",
Typescript::SLASHEQ => "/=",
Typescript::PERCENTEQ => "%=",
Typescript::CARETEQ => "^=",
Typescript::AMPEQ => "&=",
Typescript::PIPEEQ => "|=",
Typescript::GTGTEQ => ">>=",
Typescript::GTGTGTEQ => ">>>=",
Typescript::LTLTEQ => "<<=",
Typescript::STARSTAREQ => "**=",
Typescript::AMPAMPEQ => "&&=",
Typescript::PIPEPIPEEQ => "||=",
Typescript::QMARKQMARKEQ => "??=",
Typescript::DOTDOTDOT => "...",
Typescript::AMPAMP => "&&",
Typescript::PIPEPIPE => "||",
Typescript::GTGT => ">>",
Typescript::GTGTGT => ">>>",
Typescript::LTLT => "<<",
Typescript::AMP => "&",
Typescript::CARET => "^",
Typescript::PIPE => "|",
Typescript::PLUS => "+",
Typescript::DASH => "-",
Typescript::PERCENT => "%",
Typescript::STARSTAR => "**",
Typescript::LTEQ => "<=",
Typescript::EQEQ => "==",
Typescript::EQEQEQ => "===",
Typescript::BANGEQ => "!=",
Typescript::BANGEQEQ => "!==",
Typescript::GTEQ => ">=",
Typescript::QMARKQMARK => "??",
Typescript::Instanceof => "instanceof",
Typescript::TILDE => "~",
Typescript::Void => "void",
Typescript::Delete => "delete",
Typescript::PLUSPLUS => "++",
Typescript::DASHDASH => "--",
Typescript::DQUOTE => "\"",
Typescript::SQUOTE => "'",
Typescript::StringFragment => "string_fragment",
Typescript::StringFragment2 => "string_fragment",
Typescript::EscapeSequence => "escape_sequence",
Typescript::Comment => "comment",
Typescript::BQUOTE => "`",
Typescript::DOLLARLBRACE => "${",
Typescript::SLASH2 => "/",
Typescript::RegexPattern => "regex_pattern",
Typescript::RegexFlags => "regex_flags",
Typescript::Number => "number",
Typescript::PrivatePropertyIdentifier => "private_property_identifier",
Typescript::Target => "target",
Typescript::This => "this",
Typescript::Super => "super",
Typescript::True => "true",
Typescript::False => "false",
Typescript::Null => "null",
Typescript::Undefined => "undefined",
Typescript::AT => "@",
Typescript::Static => "static",
Typescript::Readonly => "readonly",
Typescript::Get => "get",
Typescript::Set => "set",
Typescript::QMARK => "?",
Typescript::Declare => "declare",
Typescript::Public => "public",
Typescript::Private => "private",
Typescript::Protected => "protected",
Typescript::Override => "override",
Typescript::Module2 => "module",
Typescript::Any => "any",
Typescript::Number2 => "number",
Typescript::Boolean => "boolean",
Typescript::String2 => "string",
Typescript::Symbol => "symbol",
Typescript::Abstract => "abstract",
Typescript::Require => "require",
Typescript::Extends => "extends",
Typescript::Implements => "implements",
Typescript::Global => "global",
Typescript::Interface => "interface",
Typescript::Enum => "enum",
Typescript::DASHQMARKCOLON => "-?:",
Typescript::QMARKCOLON => "?:",
Typescript::Asserts2 => "asserts",
Typescript::Infer => "infer",
Typescript::Is => "is",
Typescript::Keyof => "keyof",
Typescript::Unknown => "unknown",
Typescript::Never => "never",
Typescript::Object2 => "object",
Typescript::LBRACEPIPE => "{|",
Typescript::PIPERBRACE => "|}",
Typescript::AutomaticSemicolon => "_automatic_semicolon",
Typescript::TemplateChars => "_template_chars",
Typescript::QMARK2 => "?",
Typescript::FunctionSignatureAutomaticSemicolon => {
"_function_signature_automatic_semicolon"
}
Typescript::Program => "program",
Typescript::ExportStatement => "export_statement",
Typescript::ExportClause => "export_clause",
Typescript::ExportSpecifier => "export_specifier",
Typescript::Declaration => "declaration",
Typescript::Import => "import",
Typescript::ImportStatement => "import_statement",
Typescript::ImportClause => "import_clause",
Typescript::FromClause => "_from_clause",
Typescript::NamespaceImport => "namespace_import",
Typescript::NamedImports => "named_imports",
Typescript::ExpressionStatement => "expression_statement",
Typescript::VariableDeclaration => "variable_declaration",
Typescript::LexicalDeclaration => "lexical_declaration",
Typescript::VariableDeclarator => "variable_declarator",
Typescript::StatementBlock => "statement_block",
Typescript::ElseClause => "else_clause",
Typescript::IfStatement => "if_statement",
Typescript::SwitchStatement => "switch_statement",
Typescript::ForStatement => "for_statement",
Typescript::ForInStatement => "for_in_statement",
Typescript::ForHeader => "_for_header",
Typescript::WhileStatement => "while_statement",
Typescript::DoStatement => "do_statement",
Typescript::TryStatement => "try_statement",
Typescript::WithStatement => "with_statement",
Typescript::BreakStatement => "break_statement",
Typescript::ContinueStatement => "continue_statement",
Typescript::DebuggerStatement => "debugger_statement",
Typescript::ReturnStatement => "return_statement",
Typescript::ThrowStatement => "throw_statement",
Typescript::EmptyStatement => "empty_statement",
Typescript::LabeledStatement => "labeled_statement",
Typescript::SwitchBody => "switch_body",
Typescript::SwitchCase => "switch_case",
Typescript::SwitchDefault => "switch_default",
Typescript::CatchClause => "catch_clause",
Typescript::FinallyClause => "finally_clause",
Typescript::ParenthesizedExpression => "parenthesized_expression",
Typescript::Expression => "expression",
Typescript::PrimaryExpression => "primary_expression",
Typescript::YieldExpression => "yield_expression",
Typescript::Object => "object",
Typescript::ObjectPattern => "object_pattern",
Typescript::AssignmentPattern => "assignment_pattern",
Typescript::ObjectAssignmentPattern => "object_assignment_pattern",
Typescript::Array => "array",
Typescript::ArrayPattern => "array_pattern",
Typescript::NestedIdentifier => "nested_identifier",
Typescript::Class => "class",
Typescript::ClassDeclaration => "class_declaration",
Typescript::ClassHeritage => "class_heritage",
Typescript::Function => "function",
Typescript::FunctionDeclaration => "function_declaration",
Typescript::GeneratorFunction => "generator_function",
Typescript::GeneratorFunctionDeclaration => "generator_function_declaration",
Typescript::ArrowFunction => "arrow_function",
Typescript::CallSignature2 => "_call_signature",
Typescript::FormalParameter => "_formal_parameter",
Typescript::CallExpression => "call_expression",
Typescript::NewExpression => "new_expression",
Typescript::AwaitExpression => "await_expression",
Typescript::MemberExpression => "member_expression",
Typescript::SubscriptExpression => "subscript_expression",
Typescript::AssignmentExpression => "assignment_expression",
Typescript::AugmentedAssignmentLhs => "_augmented_assignment_lhs",
Typescript::AugmentedAssignmentExpression => "augmented_assignment_expression",
Typescript::Initializer => "_initializer",
Typescript::DestructuringPattern => "_destructuring_pattern",
Typescript::SpreadElement => "spread_element",
Typescript::TernaryExpression => "ternary_expression",
Typescript::BinaryExpression => "binary_expression",
Typescript::UnaryExpression => "unary_expression",
Typescript::UpdateExpression => "update_expression",
Typescript::SequenceExpression => "sequence_expression",
Typescript::String => "string",
Typescript::TemplateString => "template_string",
Typescript::TemplateSubstitution => "template_substitution",
Typescript::Regex => "regex",
Typescript::MetaProperty => "meta_property",
Typescript::Arguments => "arguments",
Typescript::Decorator => "decorator",
Typescript::MemberExpression2 => "member_expression",
Typescript::CallExpression2 => "call_expression",
Typescript::ClassBody => "class_body",
Typescript::FormalParameters => "formal_parameters",
Typescript::Pattern => "pattern",
Typescript::RestPattern => "rest_pattern",
Typescript::MethodDefinition => "method_definition",
Typescript::Pair => "pair",
Typescript::PairPattern => "pair_pattern",
Typescript::PropertyName => "_property_name",
Typescript::ComputedPropertyName => "computed_property_name",
Typescript::PublicFieldDefinition => "public_field_definition",
Typescript::NonNullExpression => "non_null_expression",
Typescript::MethodSignature => "method_signature",
Typescript::AbstractMethodSignature => "abstract_method_signature",
Typescript::FunctionSignature => "function_signature",
Typescript::TypeAssertion => "type_assertion",
Typescript::AsExpression => "as_expression",
Typescript::ImportRequireClause => "import_require_clause",
Typescript::ExtendsClause => "extends_clause",
Typescript::ImplementsClause => "implements_clause",
Typescript::AmbientDeclaration => "ambient_declaration",
Typescript::AbstractClassDeclaration => "abstract_class_declaration",
Typescript::Module => "module",
Typescript::InternalModule => "internal_module",
Typescript::Module3 => "_module",
Typescript::ImportAlias => "import_alias",
Typescript::NestedTypeIdentifier => "nested_type_identifier",
Typescript::InterfaceDeclaration => "interface_declaration",
Typescript::ExtendsTypeClause => "extends_type_clause",
Typescript::EnumDeclaration => "enum_declaration",
Typescript::EnumBody => "enum_body",
Typescript::EnumAssignment => "enum_assignment",
Typescript::TypeAliasDeclaration => "type_alias_declaration",
Typescript::AccessibilityModifier => "accessibility_modifier",
Typescript::OverrideModifier => "override_modifier",
Typescript::RequiredParameter => "required_parameter",
Typescript::OptionalParameter => "optional_parameter",
Typescript::ParameterName => "_parameter_name",
Typescript::OmittingTypeAnnotation => "omitting_type_annotation",
Typescript::OptingTypeAnnotation => "opting_type_annotation",
Typescript::TypeAnnotation => "type_annotation",
Typescript::Asserts => "asserts",
Typescript::Type2 => "_type",
Typescript::RequiredParameter2 => "required_parameter",
Typescript::OptionalParameter2 => "optional_parameter",
Typescript::OptionalType => "optional_type",
Typescript::RestType => "rest_type",
Typescript::TupleTypeMember => "_tuple_type_member",
Typescript::ConstructorType => "constructor_type",
Typescript::PrimaryType => "_primary_type",
Typescript::TemplateType => "template_type",
Typescript::TemplateLiteralType => "template_literal_type",
Typescript::InferType => "infer_type",
Typescript::ConditionalType => "conditional_type",
Typescript::GenericType => "generic_type",
Typescript::TypePredicate => "type_predicate",
Typescript::TypePredicateAnnotation => "type_predicate_annotation",
Typescript::MemberExpression3 => "member_expression",
Typescript::SubscriptExpression2 => "subscript_expression",
Typescript::CallExpression3 => "call_expression",
Typescript::TypeQuery => "type_query",
Typescript::IndexTypeQuery => "index_type_query",
Typescript::LookupType => "lookup_type",
Typescript::MappedTypeClause => "mapped_type_clause",
Typescript::LiteralType => "literal_type",
Typescript::UnaryExpression2 => "unary_expression",
Typescript::ExistentialType => "existential_type",
Typescript::FlowMaybeType => "flow_maybe_type",
Typescript::ParenthesizedType => "parenthesized_type",
Typescript::PredefinedType => "predefined_type",
Typescript::TypeArguments => "type_arguments",
Typescript::ObjectType => "object_type",
Typescript::CallSignature => "call_signature",
Typescript::PropertySignature => "property_signature",
Typescript::TypeParameters => "type_parameters",
Typescript::TypeParameter => "type_parameter",
Typescript::DefaultType => "default_type",
Typescript::Constraint => "constraint",
Typescript::ConstructSignature => "construct_signature",
Typescript::IndexSignature => "index_signature",
Typescript::ArrayType => "array_type",
Typescript::TupleType => "tuple_type",
Typescript::ReadonlyType => "readonly_type",
Typescript::UnionType => "union_type",
Typescript::IntersectionType => "intersection_type",
Typescript::FunctionType => "function_type",
Typescript::ProgramRepeat1 => "program_repeat1",
Typescript::ExportStatementRepeat1 => "export_statement_repeat1",
Typescript::ExportClauseRepeat1 => "export_clause_repeat1",
Typescript::NamedImportsRepeat1 => "named_imports_repeat1",
Typescript::VariableDeclarationRepeat1 => "variable_declaration_repeat1",
Typescript::SwitchBodyRepeat1 => "switch_body_repeat1",
Typescript::ObjectRepeat1 => "object_repeat1",
Typescript::ObjectPatternRepeat1 => "object_pattern_repeat1",
Typescript::ArrayRepeat1 => "array_repeat1",
Typescript::ArrayPatternRepeat1 => "array_pattern_repeat1",
Typescript::StringRepeat1 => "string_repeat1",
Typescript::StringRepeat2 => "string_repeat2",
Typescript::TemplateStringRepeat1 => "template_string_repeat1",
Typescript::ClassBodyRepeat1 => "class_body_repeat1",
Typescript::FormalParametersRepeat1 => "formal_parameters_repeat1",
Typescript::ExtendsClauseRepeat1 => "extends_clause_repeat1",
Typescript::ImplementsClauseRepeat1 => "implements_clause_repeat1",
Typescript::ExtendsTypeClauseRepeat1 => "extends_type_clause_repeat1",
Typescript::EnumBodyRepeat1 => "enum_body_repeat1",
Typescript::TemplateLiteralTypeRepeat1 => "template_literal_type_repeat1",
Typescript::ObjectTypeRepeat1 => "object_type_repeat1",
Typescript::TypeParametersRepeat1 => "type_parameters_repeat1",
Typescript::TupleTypeRepeat1 => "tuple_type_repeat1",
Typescript::ImportSpecifier => "import_specifier",
Typescript::NamespaceExport => "namespace_export",
Typescript::PropertyIdentifier => "property_identifier",
Typescript::ShorthandPropertyIdentifier => "shorthand_property_identifier",
Typescript::ShorthandPropertyIdentifierPattern => {
"shorthand_property_identifier_pattern"
}
Typescript::StatementIdentifier => "statement_identifier",
Typescript::ThisType => "this_type",
Typescript::TypeIdentifier => "type_identifier",
Typescript::Error => "ERROR",
}
}
}
impl From<u16> for Typescript {
#[inline(always)]
fn from(x: u16) -> Self {
num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
}
}
impl PartialEq<u16> for Typescript {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Typescript::from(*x)
}
}
impl PartialEq<Typescript> for u16 {
#[inline(always)]
fn eq(&self, x: &Typescript) -> bool {
*x == *self
}
}