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