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