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