// Code generated; DO NOT EDIT.

use num_derive::FromPrimitive;

#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub(crate) enum Tsx {
    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,
    With = 16,
    Assert = 17,
    Var = 18,
    Let = 19,
    Const = 20,
    BANG = 21,
    Else = 22,
    If = 23,
    Switch = 24,
    For = 25,
    LPAREN = 26,
    SEMI = 27,
    RPAREN = 28,
    Await = 29,
    In = 30,
    Of = 31,
    While = 32,
    Do = 33,
    Try = 34,
    Break = 35,
    Continue = 36,
    Debugger = 37,
    Return = 38,
    Throw = 39,
    COLON = 40,
    Case = 41,
    Catch = 42,
    Finally = 43,
    Yield = 44,
    LBRACK = 45,
    RBRACK = 46,
    HtmlCharacterReference = 47,
    GT = 48,
    Identifier2 = 49,
    DOT = 50,
    LTSLASH = 51,
    SLASHGT = 52,
    DQUOTE = 53,
    SQUOTE = 54,
    StringFragment = 55,
    StringFragment2 = 56,
    Class2 = 57,
    Async = 58,
    Function = 59,
    EQGT = 60,
    QMARKDOT = 61,
    New = 62,
    Using = 63,
    PLUSEQ = 64,
    DASHEQ = 65,
    STAREQ = 66,
    SLASHEQ = 67,
    PERCENTEQ = 68,
    CARETEQ = 69,
    AMPEQ = 70,
    PIPEEQ = 71,
    GTGTEQ = 72,
    GTGTGTEQ = 73,
    LTLTEQ = 74,
    STARSTAREQ = 75,
    AMPAMPEQ = 76,
    PIPEPIPEEQ = 77,
    QMARKQMARKEQ = 78,
    DOTDOTDOT = 79,
    AMPAMP = 80,
    PIPEPIPE = 81,
    GTGT = 82,
    GTGTGT = 83,
    LTLT = 84,
    AMP = 85,
    CARET = 86,
    PIPE = 87,
    PLUS = 88,
    DASH = 89,
    SLASH = 90,
    PERCENT = 91,
    STARSTAR = 92,
    LT = 93,
    LTEQ = 94,
    EQEQ = 95,
    EQEQEQ = 96,
    BANGEQ = 97,
    BANGEQEQ = 98,
    GTEQ = 99,
    QMARKQMARK = 100,
    Instanceof = 101,
    TILDE = 102,
    Void = 103,
    Delete = 104,
    PLUSPLUS = 105,
    DASHDASH = 106,
    StringFragment3 = 107,
    StringFragment4 = 108,
    EscapeSequence = 109,
    Comment = 110,
    BQUOTE = 111,
    DOLLARLBRACE = 112,
    SLASH2 = 113,
    RegexPattern = 114,
    RegexFlags = 115,
    Number = 116,
    PrivatePropertyIdentifier = 117,
    Target = 118,
    Meta = 119,
    This = 120,
    Super = 121,
    True = 122,
    False = 123,
    Null = 124,
    Undefined = 125,
    AT = 126,
    Static = 127,
    Readonly = 128,
    Get = 129,
    Set = 130,
    QMARK = 131,
    Declare = 132,
    Public = 133,
    Private = 134,
    Protected = 135,
    Override = 136,
    Module2 = 137,
    Any = 138,
    Number2 = 139,
    Boolean = 140,
    String3 = 141,
    Symbol = 142,
    Object2 = 143,
    Abstract = 144,
    Accessor = 145,
    Satisfies = 146,
    Require = 147,
    Extends = 148,
    Implements = 149,
    Global = 150,
    Interface = 151,
    Enum = 152,
    DASHQMARKCOLON = 153,
    PLUSQMARKCOLON = 154,
    QMARKCOLON = 155,
    Asserts2 = 156,
    Infer = 157,
    Is = 158,
    Keyof = 159,
    Uniquesymbol = 160,
    Unknown = 161,
    Never = 162,
    LBRACEPIPE = 163,
    PIPERBRACE = 164,
    AutomaticSemicolon = 165,
    StringFragment5 = 166,
    QMARK2 = 167,
    HtmlComment = 168,
    JsxText = 169,
    FunctionSignatureAutomaticSemicolon = 170,
    ErrorRecovery = 171,
    Program = 172,
    ExportStatement = 173,
    NamespaceExport = 174,
    ExportClause = 175,
    ExportSpecifier = 176,
    ModuleExportName = 177,
    Declaration = 178,
    Import = 179,
    ImportStatement = 180,
    ImportClause = 181,
    FromClause = 182,
    NamespaceImport = 183,
    NamedImports = 184,
    ImportSpecifier = 185,
    ImportAttribute = 186,
    Statement = 187,
    ExpressionStatement = 188,
    VariableDeclaration = 189,
    LexicalDeclaration = 190,
    VariableDeclarator = 191,
    StatementBlock = 192,
    ElseClause = 193,
    IfStatement = 194,
    SwitchStatement = 195,
    ForStatement = 196,
    ForInStatement = 197,
    ForHeader = 198,
    WhileStatement = 199,
    DoStatement = 200,
    TryStatement = 201,
    WithStatement = 202,
    BreakStatement = 203,
    ContinueStatement = 204,
    DebuggerStatement = 205,
    ReturnStatement = 206,
    ThrowStatement = 207,
    EmptyStatement = 208,
    LabeledStatement = 209,
    SwitchBody = 210,
    SwitchCase = 211,
    SwitchDefault = 212,
    CatchClause = 213,
    FinallyClause = 214,
    ParenthesizedExpression = 215,
    Expression = 216,
    PrimaryExpression = 217,
    YieldExpression = 218,
    Object = 219,
    ObjectPattern = 220,
    AssignmentPattern = 221,
    ObjectAssignmentPattern = 222,
    Array = 223,
    ArrayPattern = 224,
    JsxElement = 225,
    JsxExpression = 226,
    JsxOpeningElement = 227,
    NestedIdentifier = 228,
    JsxNamespaceName = 229,
    JsxClosingElement = 230,
    JsxSelfClosingElement = 231,
    JsxAttribute = 232,
    String = 233,
    Class = 234,
    ClassDeclaration = 235,
    ClassHeritage = 236,
    FunctionExpression = 237,
    FunctionDeclaration = 238,
    GeneratorFunction = 239,
    GeneratorFunctionDeclaration = 240,
    ArrowFunction = 241,
    CallSignature2 = 242,
    FormalParameter = 243,
    OptionalChain = 244,
    CallExpression = 245,
    NewExpression = 246,
    AwaitExpression = 247,
    MemberExpression = 248,
    SubscriptExpression = 249,
    AssignmentExpression = 250,
    AugmentedAssignmentLhs = 251,
    AugmentedAssignmentExpression = 252,
    Initializer = 253,
    DestructuringPattern = 254,
    SpreadElement = 255,
    TernaryExpression = 256,
    BinaryExpression = 257,
    UnaryExpression = 258,
    UpdateExpression = 259,
    SequenceExpression = 260,
    String2 = 261,
    TemplateString = 262,
    TemplateSubstitution = 263,
    Regex = 264,
    MetaProperty = 265,
    Arguments = 266,
    Decorator = 267,
    MemberExpression2 = 268,
    CallExpression2 = 269,
    ClassBody = 270,
    FormalParameters = 271,
    ClassStaticBlock = 272,
    Pattern = 273,
    RestPattern = 274,
    MethodDefinition = 275,
    Pair = 276,
    PairPattern = 277,
    PropertyName = 278,
    ComputedPropertyName = 279,
    PublicFieldDefinition = 280,
    ImportIdentifier = 281,
    NonNullExpression = 282,
    MethodSignature = 283,
    AbstractMethodSignature = 284,
    FunctionSignature = 285,
    ParenthesizedExpression2 = 286,
    AsExpression = 287,
    SatisfiesExpression = 288,
    InstantiationExpression = 289,
    ImportRequireClause = 290,
    ExtendsClause = 291,
    ExtendsClauseSingle = 292,
    ImplementsClause = 293,
    AmbientDeclaration = 294,
    AbstractClassDeclaration = 295,
    Module = 296,
    InternalModule = 297,
    Module3 = 298,
    ImportAlias = 299,
    NestedTypeIdentifier = 300,
    InterfaceDeclaration = 301,
    ExtendsTypeClause = 302,
    EnumDeclaration = 303,
    EnumBody = 304,
    EnumAssignment = 305,
    TypeAliasDeclaration = 306,
    AccessibilityModifier = 307,
    OverrideModifier = 308,
    RequiredParameter = 309,
    OptionalParameter = 310,
    ParameterName = 311,
    OmittingTypeAnnotation = 312,
    AddingTypeAnnotation = 313,
    OptingTypeAnnotation = 314,
    TypeAnnotation = 315,
    MemberExpression3 = 316,
    CallExpression3 = 317,
    Asserts = 318,
    AssertsAnnotation = 319,
    Type2 = 320,
    RequiredParameter2 = 321,
    OptionalParameter2 = 322,
    OptionalType = 323,
    RestType = 324,
    TupleTypeMember = 325,
    ConstructorType = 326,
    PrimaryType = 327,
    TemplateType = 328,
    TemplateLiteralType = 329,
    InferType = 330,
    ConditionalType = 331,
    GenericType = 332,
    TypePredicate = 333,
    TypePredicateAnnotation = 334,
    MemberExpression4 = 335,
    SubscriptExpression2 = 336,
    CallExpression4 = 337,
    InstantiationExpression2 = 338,
    TypeQuery = 339,
    IndexTypeQuery = 340,
    LookupType = 341,
    MappedTypeClause = 342,
    LiteralType = 343,
    UnaryExpression2 = 344,
    ExistentialType = 345,
    FlowMaybeType = 346,
    ParenthesizedType = 347,
    PredefinedType = 348,
    TypeArguments = 349,
    ObjectType = 350,
    CallSignature = 351,
    PropertySignature = 352,
    TypeParameters = 353,
    TypeParameter = 354,
    DefaultType = 355,
    Constraint = 356,
    ConstructSignature = 357,
    IndexSignature = 358,
    ArrayType = 359,
    TupleType = 360,
    ReadonlyType = 361,
    UnionType = 362,
    IntersectionType = 363,
    FunctionType = 364,
    ProgramRepeat1 = 365,
    ExportStatementRepeat1 = 366,
    ExportClauseRepeat1 = 367,
    NamedImportsRepeat1 = 368,
    VariableDeclarationRepeat1 = 369,
    SwitchBodyRepeat1 = 370,
    ObjectRepeat1 = 371,
    ObjectPatternRepeat1 = 372,
    ArrayRepeat1 = 373,
    ArrayPatternRepeat1 = 374,
    JsxElementRepeat1 = 375,
    JsxStringRepeat1 = 376,
    JsxStringRepeat2 = 377,
    SequenceExpressionRepeat1 = 378,
    StringRepeat1 = 379,
    StringRepeat2 = 380,
    TemplateStringRepeat1 = 381,
    ClassBodyRepeat1 = 382,
    FormalParametersRepeat1 = 383,
    JsxStartOpeningElementRepeat1 = 384,
    ExtendsClauseRepeat1 = 385,
    ImplementsClauseRepeat1 = 386,
    ExtendsTypeClauseRepeat1 = 387,
    EnumBodyRepeat1 = 388,
    TemplateLiteralTypeRepeat1 = 389,
    ObjectTypeRepeat1 = 390,
    TypeParametersRepeat1 = 391,
    TupleTypeRepeat1 = 392,
    InterfaceBody = 393,
    PropertyIdentifier = 394,
    ShorthandPropertyIdentifier = 395,
    ShorthandPropertyIdentifierPattern = 396,
    StatementIdentifier = 397,
    ThisType = 398,
    TypeIdentifier = 399,
    Error = 400,
}

impl From<Tsx> for &'static str {
    #[inline(always)]
    fn from(tok: Tsx) -> Self {
        match tok {
            Tsx::End => "end",
            Tsx::Identifier => "identifier",
            Tsx::HashBangLine => "hash_bang_line",
            Tsx::Export => "export",
            Tsx::STAR => "*",
            Tsx::Default => "default",
            Tsx::Type => "type",
            Tsx::EQ => "=",
            Tsx::As => "as",
            Tsx::Namespace => "namespace",
            Tsx::LBRACE => "{",
            Tsx::COMMA => ",",
            Tsx::RBRACE => "}",
            Tsx::Typeof => "typeof",
            Tsx::Import2 => "import",
            Tsx::From => "from",
            Tsx::With => "with",
            Tsx::Assert => "assert",
            Tsx::Var => "var",
            Tsx::Let => "let",
            Tsx::Const => "const",
            Tsx::BANG => "!",
            Tsx::Else => "else",
            Tsx::If => "if",
            Tsx::Switch => "switch",
            Tsx::For => "for",
            Tsx::LPAREN => "(",
            Tsx::SEMI => ";",
            Tsx::RPAREN => ")",
            Tsx::Await => "await",
            Tsx::In => "in",
            Tsx::Of => "of",
            Tsx::While => "while",
            Tsx::Do => "do",
            Tsx::Try => "try",
            Tsx::Break => "break",
            Tsx::Continue => "continue",
            Tsx::Debugger => "debugger",
            Tsx::Return => "return",
            Tsx::Throw => "throw",
            Tsx::COLON => ":",
            Tsx::Case => "case",
            Tsx::Catch => "catch",
            Tsx::Finally => "finally",
            Tsx::Yield => "yield",
            Tsx::LBRACK => "[",
            Tsx::RBRACK => "]",
            Tsx::HtmlCharacterReference => "html_character_reference",
            Tsx::GT => ">",
            Tsx::Identifier2 => "identifier",
            Tsx::DOT => ".",
            Tsx::LTSLASH => "</",
            Tsx::SLASHGT => "/>",
            Tsx::DQUOTE => "\"",
            Tsx::SQUOTE => "'",
            Tsx::StringFragment => "string_fragment",
            Tsx::StringFragment2 => "string_fragment",
            Tsx::Class2 => "class",
            Tsx::Async => "async",
            Tsx::Function => "function",
            Tsx::EQGT => "=>",
            Tsx::QMARKDOT => "?.",
            Tsx::New => "new",
            Tsx::Using => "using",
            Tsx::PLUSEQ => "+=",
            Tsx::DASHEQ => "-=",
            Tsx::STAREQ => "*=",
            Tsx::SLASHEQ => "/=",
            Tsx::PERCENTEQ => "%=",
            Tsx::CARETEQ => "^=",
            Tsx::AMPEQ => "&=",
            Tsx::PIPEEQ => "|=",
            Tsx::GTGTEQ => ">>=",
            Tsx::GTGTGTEQ => ">>>=",
            Tsx::LTLTEQ => "<<=",
            Tsx::STARSTAREQ => "**=",
            Tsx::AMPAMPEQ => "&&=",
            Tsx::PIPEPIPEEQ => "||=",
            Tsx::QMARKQMARKEQ => "??=",
            Tsx::DOTDOTDOT => "...",
            Tsx::AMPAMP => "&&",
            Tsx::PIPEPIPE => "||",
            Tsx::GTGT => ">>",
            Tsx::GTGTGT => ">>>",
            Tsx::LTLT => "<<",
            Tsx::AMP => "&",
            Tsx::CARET => "^",
            Tsx::PIPE => "|",
            Tsx::PLUS => "+",
            Tsx::DASH => "-",
            Tsx::SLASH => "/",
            Tsx::PERCENT => "%",
            Tsx::STARSTAR => "**",
            Tsx::LT => "<",
            Tsx::LTEQ => "<=",
            Tsx::EQEQ => "==",
            Tsx::EQEQEQ => "===",
            Tsx::BANGEQ => "!=",
            Tsx::BANGEQEQ => "!==",
            Tsx::GTEQ => ">=",
            Tsx::QMARKQMARK => "??",
            Tsx::Instanceof => "instanceof",
            Tsx::TILDE => "~",
            Tsx::Void => "void",
            Tsx::Delete => "delete",
            Tsx::PLUSPLUS => "++",
            Tsx::DASHDASH => "--",
            Tsx::StringFragment3 => "string_fragment",
            Tsx::StringFragment4 => "string_fragment",
            Tsx::EscapeSequence => "escape_sequence",
            Tsx::Comment => "comment",
            Tsx::BQUOTE => "`",
            Tsx::DOLLARLBRACE => "${",
            Tsx::SLASH2 => "/",
            Tsx::RegexPattern => "regex_pattern",
            Tsx::RegexFlags => "regex_flags",
            Tsx::Number => "number",
            Tsx::PrivatePropertyIdentifier => "private_property_identifier",
            Tsx::Target => "target",
            Tsx::Meta => "meta",
            Tsx::This => "this",
            Tsx::Super => "super",
            Tsx::True => "true",
            Tsx::False => "false",
            Tsx::Null => "null",
            Tsx::Undefined => "undefined",
            Tsx::AT => "@",
            Tsx::Static => "static",
            Tsx::Readonly => "readonly",
            Tsx::Get => "get",
            Tsx::Set => "set",
            Tsx::QMARK => "?",
            Tsx::Declare => "declare",
            Tsx::Public => "public",
            Tsx::Private => "private",
            Tsx::Protected => "protected",
            Tsx::Override => "override",
            Tsx::Module2 => "module",
            Tsx::Any => "any",
            Tsx::Number2 => "number",
            Tsx::Boolean => "boolean",
            Tsx::String3 => "string",
            Tsx::Symbol => "symbol",
            Tsx::Object2 => "object",
            Tsx::Abstract => "abstract",
            Tsx::Accessor => "accessor",
            Tsx::Satisfies => "satisfies",
            Tsx::Require => "require",
            Tsx::Extends => "extends",
            Tsx::Implements => "implements",
            Tsx::Global => "global",
            Tsx::Interface => "interface",
            Tsx::Enum => "enum",
            Tsx::DASHQMARKCOLON => "-?:",
            Tsx::PLUSQMARKCOLON => "+?:",
            Tsx::QMARKCOLON => "?:",
            Tsx::Asserts2 => "asserts",
            Tsx::Infer => "infer",
            Tsx::Is => "is",
            Tsx::Keyof => "keyof",
            Tsx::Uniquesymbol => "unique symbol",
            Tsx::Unknown => "unknown",
            Tsx::Never => "never",
            Tsx::LBRACEPIPE => "{|",
            Tsx::PIPERBRACE => "|}",
            Tsx::AutomaticSemicolon => "_automatic_semicolon",
            Tsx::StringFragment5 => "string_fragment",
            Tsx::QMARK2 => "?",
            Tsx::HtmlComment => "html_comment",
            Tsx::JsxText => "jsx_text",
            Tsx::FunctionSignatureAutomaticSemicolon => "_function_signature_automatic_semicolon",
            Tsx::ErrorRecovery => "__error_recovery",
            Tsx::Program => "program",
            Tsx::ExportStatement => "export_statement",
            Tsx::NamespaceExport => "namespace_export",
            Tsx::ExportClause => "export_clause",
            Tsx::ExportSpecifier => "export_specifier",
            Tsx::ModuleExportName => "_module_export_name",
            Tsx::Declaration => "declaration",
            Tsx::Import => "import",
            Tsx::ImportStatement => "import_statement",
            Tsx::ImportClause => "import_clause",
            Tsx::FromClause => "_from_clause",
            Tsx::NamespaceImport => "namespace_import",
            Tsx::NamedImports => "named_imports",
            Tsx::ImportSpecifier => "import_specifier",
            Tsx::ImportAttribute => "import_attribute",
            Tsx::Statement => "statement",
            Tsx::ExpressionStatement => "expression_statement",
            Tsx::VariableDeclaration => "variable_declaration",
            Tsx::LexicalDeclaration => "lexical_declaration",
            Tsx::VariableDeclarator => "variable_declarator",
            Tsx::StatementBlock => "statement_block",
            Tsx::ElseClause => "else_clause",
            Tsx::IfStatement => "if_statement",
            Tsx::SwitchStatement => "switch_statement",
            Tsx::ForStatement => "for_statement",
            Tsx::ForInStatement => "for_in_statement",
            Tsx::ForHeader => "_for_header",
            Tsx::WhileStatement => "while_statement",
            Tsx::DoStatement => "do_statement",
            Tsx::TryStatement => "try_statement",
            Tsx::WithStatement => "with_statement",
            Tsx::BreakStatement => "break_statement",
            Tsx::ContinueStatement => "continue_statement",
            Tsx::DebuggerStatement => "debugger_statement",
            Tsx::ReturnStatement => "return_statement",
            Tsx::ThrowStatement => "throw_statement",
            Tsx::EmptyStatement => "empty_statement",
            Tsx::LabeledStatement => "labeled_statement",
            Tsx::SwitchBody => "switch_body",
            Tsx::SwitchCase => "switch_case",
            Tsx::SwitchDefault => "switch_default",
            Tsx::CatchClause => "catch_clause",
            Tsx::FinallyClause => "finally_clause",
            Tsx::ParenthesizedExpression => "parenthesized_expression",
            Tsx::Expression => "expression",
            Tsx::PrimaryExpression => "primary_expression",
            Tsx::YieldExpression => "yield_expression",
            Tsx::Object => "object",
            Tsx::ObjectPattern => "object_pattern",
            Tsx::AssignmentPattern => "assignment_pattern",
            Tsx::ObjectAssignmentPattern => "object_assignment_pattern",
            Tsx::Array => "array",
            Tsx::ArrayPattern => "array_pattern",
            Tsx::JsxElement => "jsx_element",
            Tsx::JsxExpression => "jsx_expression",
            Tsx::JsxOpeningElement => "jsx_opening_element",
            Tsx::NestedIdentifier => "nested_identifier",
            Tsx::JsxNamespaceName => "jsx_namespace_name",
            Tsx::JsxClosingElement => "jsx_closing_element",
            Tsx::JsxSelfClosingElement => "jsx_self_closing_element",
            Tsx::JsxAttribute => "jsx_attribute",
            Tsx::String => "string",
            Tsx::Class => "class",
            Tsx::ClassDeclaration => "class_declaration",
            Tsx::ClassHeritage => "class_heritage",
            Tsx::FunctionExpression => "function_expression",
            Tsx::FunctionDeclaration => "function_declaration",
            Tsx::GeneratorFunction => "generator_function",
            Tsx::GeneratorFunctionDeclaration => "generator_function_declaration",
            Tsx::ArrowFunction => "arrow_function",
            Tsx::CallSignature2 => "_call_signature",
            Tsx::FormalParameter => "_formal_parameter",
            Tsx::OptionalChain => "optional_chain",
            Tsx::CallExpression => "call_expression",
            Tsx::NewExpression => "new_expression",
            Tsx::AwaitExpression => "await_expression",
            Tsx::MemberExpression => "member_expression",
            Tsx::SubscriptExpression => "subscript_expression",
            Tsx::AssignmentExpression => "assignment_expression",
            Tsx::AugmentedAssignmentLhs => "_augmented_assignment_lhs",
            Tsx::AugmentedAssignmentExpression => "augmented_assignment_expression",
            Tsx::Initializer => "_initializer",
            Tsx::DestructuringPattern => "_destructuring_pattern",
            Tsx::SpreadElement => "spread_element",
            Tsx::TernaryExpression => "ternary_expression",
            Tsx::BinaryExpression => "binary_expression",
            Tsx::UnaryExpression => "unary_expression",
            Tsx::UpdateExpression => "update_expression",
            Tsx::SequenceExpression => "sequence_expression",
            Tsx::String2 => "string",
            Tsx::TemplateString => "template_string",
            Tsx::TemplateSubstitution => "template_substitution",
            Tsx::Regex => "regex",
            Tsx::MetaProperty => "meta_property",
            Tsx::Arguments => "arguments",
            Tsx::Decorator => "decorator",
            Tsx::MemberExpression2 => "member_expression",
            Tsx::CallExpression2 => "call_expression",
            Tsx::ClassBody => "class_body",
            Tsx::FormalParameters => "formal_parameters",
            Tsx::ClassStaticBlock => "class_static_block",
            Tsx::Pattern => "pattern",
            Tsx::RestPattern => "rest_pattern",
            Tsx::MethodDefinition => "method_definition",
            Tsx::Pair => "pair",
            Tsx::PairPattern => "pair_pattern",
            Tsx::PropertyName => "_property_name",
            Tsx::ComputedPropertyName => "computed_property_name",
            Tsx::PublicFieldDefinition => "public_field_definition",
            Tsx::ImportIdentifier => "_import_identifier",
            Tsx::NonNullExpression => "non_null_expression",
            Tsx::MethodSignature => "method_signature",
            Tsx::AbstractMethodSignature => "abstract_method_signature",
            Tsx::FunctionSignature => "function_signature",
            Tsx::ParenthesizedExpression2 => "parenthesized_expression",
            Tsx::AsExpression => "as_expression",
            Tsx::SatisfiesExpression => "satisfies_expression",
            Tsx::InstantiationExpression => "instantiation_expression",
            Tsx::ImportRequireClause => "import_require_clause",
            Tsx::ExtendsClause => "extends_clause",
            Tsx::ExtendsClauseSingle => "_extends_clause_single",
            Tsx::ImplementsClause => "implements_clause",
            Tsx::AmbientDeclaration => "ambient_declaration",
            Tsx::AbstractClassDeclaration => "abstract_class_declaration",
            Tsx::Module => "module",
            Tsx::InternalModule => "internal_module",
            Tsx::Module3 => "_module",
            Tsx::ImportAlias => "import_alias",
            Tsx::NestedTypeIdentifier => "nested_type_identifier",
            Tsx::InterfaceDeclaration => "interface_declaration",
            Tsx::ExtendsTypeClause => "extends_type_clause",
            Tsx::EnumDeclaration => "enum_declaration",
            Tsx::EnumBody => "enum_body",
            Tsx::EnumAssignment => "enum_assignment",
            Tsx::TypeAliasDeclaration => "type_alias_declaration",
            Tsx::AccessibilityModifier => "accessibility_modifier",
            Tsx::OverrideModifier => "override_modifier",
            Tsx::RequiredParameter => "required_parameter",
            Tsx::OptionalParameter => "optional_parameter",
            Tsx::ParameterName => "_parameter_name",
            Tsx::OmittingTypeAnnotation => "omitting_type_annotation",
            Tsx::AddingTypeAnnotation => "adding_type_annotation",
            Tsx::OptingTypeAnnotation => "opting_type_annotation",
            Tsx::TypeAnnotation => "type_annotation",
            Tsx::MemberExpression3 => "member_expression",
            Tsx::CallExpression3 => "call_expression",
            Tsx::Asserts => "asserts",
            Tsx::AssertsAnnotation => "asserts_annotation",
            Tsx::Type2 => "type",
            Tsx::RequiredParameter2 => "required_parameter",
            Tsx::OptionalParameter2 => "optional_parameter",
            Tsx::OptionalType => "optional_type",
            Tsx::RestType => "rest_type",
            Tsx::TupleTypeMember => "_tuple_type_member",
            Tsx::ConstructorType => "constructor_type",
            Tsx::PrimaryType => "primary_type",
            Tsx::TemplateType => "template_type",
            Tsx::TemplateLiteralType => "template_literal_type",
            Tsx::InferType => "infer_type",
            Tsx::ConditionalType => "conditional_type",
            Tsx::GenericType => "generic_type",
            Tsx::TypePredicate => "type_predicate",
            Tsx::TypePredicateAnnotation => "type_predicate_annotation",
            Tsx::MemberExpression4 => "member_expression",
            Tsx::SubscriptExpression2 => "subscript_expression",
            Tsx::CallExpression4 => "call_expression",
            Tsx::InstantiationExpression2 => "instantiation_expression",
            Tsx::TypeQuery => "type_query",
            Tsx::IndexTypeQuery => "index_type_query",
            Tsx::LookupType => "lookup_type",
            Tsx::MappedTypeClause => "mapped_type_clause",
            Tsx::LiteralType => "literal_type",
            Tsx::UnaryExpression2 => "unary_expression",
            Tsx::ExistentialType => "existential_type",
            Tsx::FlowMaybeType => "flow_maybe_type",
            Tsx::ParenthesizedType => "parenthesized_type",
            Tsx::PredefinedType => "predefined_type",
            Tsx::TypeArguments => "type_arguments",
            Tsx::ObjectType => "object_type",
            Tsx::CallSignature => "call_signature",
            Tsx::PropertySignature => "property_signature",
            Tsx::TypeParameters => "type_parameters",
            Tsx::TypeParameter => "type_parameter",
            Tsx::DefaultType => "default_type",
            Tsx::Constraint => "constraint",
            Tsx::ConstructSignature => "construct_signature",
            Tsx::IndexSignature => "index_signature",
            Tsx::ArrayType => "array_type",
            Tsx::TupleType => "tuple_type",
            Tsx::ReadonlyType => "readonly_type",
            Tsx::UnionType => "union_type",
            Tsx::IntersectionType => "intersection_type",
            Tsx::FunctionType => "function_type",
            Tsx::ProgramRepeat1 => "program_repeat1",
            Tsx::ExportStatementRepeat1 => "export_statement_repeat1",
            Tsx::ExportClauseRepeat1 => "export_clause_repeat1",
            Tsx::NamedImportsRepeat1 => "named_imports_repeat1",
            Tsx::VariableDeclarationRepeat1 => "variable_declaration_repeat1",
            Tsx::SwitchBodyRepeat1 => "switch_body_repeat1",
            Tsx::ObjectRepeat1 => "object_repeat1",
            Tsx::ObjectPatternRepeat1 => "object_pattern_repeat1",
            Tsx::ArrayRepeat1 => "array_repeat1",
            Tsx::ArrayPatternRepeat1 => "array_pattern_repeat1",
            Tsx::JsxElementRepeat1 => "jsx_element_repeat1",
            Tsx::JsxStringRepeat1 => "_jsx_string_repeat1",
            Tsx::JsxStringRepeat2 => "_jsx_string_repeat2",
            Tsx::SequenceExpressionRepeat1 => "sequence_expression_repeat1",
            Tsx::StringRepeat1 => "string_repeat1",
            Tsx::StringRepeat2 => "string_repeat2",
            Tsx::TemplateStringRepeat1 => "template_string_repeat1",
            Tsx::ClassBodyRepeat1 => "class_body_repeat1",
            Tsx::FormalParametersRepeat1 => "formal_parameters_repeat1",
            Tsx::JsxStartOpeningElementRepeat1 => "_jsx_start_opening_element_repeat1",
            Tsx::ExtendsClauseRepeat1 => "extends_clause_repeat1",
            Tsx::ImplementsClauseRepeat1 => "implements_clause_repeat1",
            Tsx::ExtendsTypeClauseRepeat1 => "extends_type_clause_repeat1",
            Tsx::EnumBodyRepeat1 => "enum_body_repeat1",
            Tsx::TemplateLiteralTypeRepeat1 => "template_literal_type_repeat1",
            Tsx::ObjectTypeRepeat1 => "object_type_repeat1",
            Tsx::TypeParametersRepeat1 => "type_parameters_repeat1",
            Tsx::TupleTypeRepeat1 => "tuple_type_repeat1",
            Tsx::InterfaceBody => "interface_body",
            Tsx::PropertyIdentifier => "property_identifier",
            Tsx::ShorthandPropertyIdentifier => "shorthand_property_identifier",
            Tsx::ShorthandPropertyIdentifierPattern => "shorthand_property_identifier_pattern",
            Tsx::StatementIdentifier => "statement_identifier",
            Tsx::ThisType => "this_type",
            Tsx::TypeIdentifier => "type_identifier",
            Tsx::Error => "ERROR",
        }
    }
}

impl From<u16> for Tsx {
    #[inline(always)]
    fn from(x: u16) -> Self {
        num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
    }
}

// Tsx == u16
impl PartialEq<u16> for Tsx {
    #[inline(always)]
    fn eq(&self, x: &u16) -> bool {
        *self == Into::<Self>::into(*x)
    }
}

// u16 == Tsx
impl PartialEq<Tsx> for u16 {
    #[inline(always)]
    fn eq(&self, x: &Tsx) -> bool {
        *x == *self
    }
}
