#[derive(Clone, Debug, PartialEq)]
pub enum Mozjs {
End = 0,
Identifier = 1,
HashBangLine = 2,
Export = 3,
STAR = 4,
Default = 5,
LBRACE = 6,
COMMA = 7,
RBRACE = 8,
As = 9,
Import2 = 10,
From = 11,
Var = 12,
Let = 13,
Const = 14,
If = 15,
Else = 16,
Switch = 17,
For = 18,
LPAREN = 19,
RPAREN = 20,
Await = 21,
In = 22,
Of = 23,
While = 24,
Do = 25,
Try = 26,
With = 27,
Break = 28,
Continue = 29,
Debugger = 30,
Return = 31,
Throw = 32,
SEMI = 33,
COLON = 34,
Case = 35,
Catch = 36,
Finally = 37,
Yield = 38,
EQ = 39,
LBRACK = 40,
RBRACK = 41,
LT = 42,
GT = 43,
SLASH = 44,
JsxText = 45,
Identifier2 = 46,
DOT = 47,
Class2 = 48,
Extends = 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,
Typeof = 90,
Void = 91,
Delete = 92,
PLUSPLUS = 93,
DASHDASH = 94,
DQUOTE = 95,
StringToken1 = 96,
SQUOTE = 97,
StringToken2 = 98,
EscapeSequence = 99,
Comment = 100,
BQUOTE = 101,
DOLLARLBRACE = 102,
SLASH2 = 103,
RegexPattern = 104,
RegexFlags = 105,
Number = 106,
Target = 107,
This = 108,
Super = 109,
True = 110,
False = 111,
Null = 112,
Undefined = 113,
AT = 114,
Static = 115,
Get = 116,
Set = 117,
Preproc = 118,
AutomaticSemicolon = 119,
TemplateChars = 120,
Program = 121,
ExportStatement = 122,
ExportClause = 123,
ImportExportSpecifier = 124,
Declaration = 125,
Import = 126,
ImportStatement = 127,
ImportClause = 128,
FromClause = 129,
NamespaceImport = 130,
NamedImports = 131,
ExpressionStatement = 132,
VariableDeclaration = 133,
LexicalDeclaration = 134,
VariableDeclarator = 135,
StatementBlock = 136,
IfStatement = 137,
SwitchStatement = 138,
ForStatement = 139,
ForInStatement = 140,
ForHeader = 141,
WhileStatement = 142,
DoStatement = 143,
TryStatement = 144,
WithStatement = 145,
BreakStatement = 146,
ContinueStatement = 147,
DebuggerStatement = 148,
ReturnStatement = 149,
ThrowStatement = 150,
EmptyStatement = 151,
LabeledStatement = 152,
SwitchBody = 153,
SwitchCase = 154,
SwitchDefault = 155,
CatchClause = 156,
FinallyClause = 157,
ParenthesizedExpression = 158,
Expression = 159,
YieldExpression = 160,
Object = 161,
AssignmentPattern = 162,
Array = 163,
JsxElement = 164,
JsxFragment = 165,
JsxExpression = 166,
JsxOpeningElement = 167,
NestedIdentifier = 168,
JsxNamespaceName = 169,
JsxClosingElement = 170,
JsxSelfClosingElement = 171,
JsxAttribute = 172,
Class = 173,
ClassDeclaration = 174,
ClassHeritage = 175,
Function = 176,
FunctionDeclaration = 177,
GeneratorFunction = 178,
GeneratorFunctionDeclaration = 179,
ArrowFunction = 180,
CallExpression = 181,
NewExpression = 182,
AwaitExpression = 183,
MemberExpression = 184,
SubscriptExpression = 185,
AssignmentExpression = 186,
AugmentedAssignmentExpression = 187,
Initializer = 188,
SpreadElement = 189,
TernaryExpression = 190,
BinaryExpression = 191,
UnaryExpression = 192,
UpdateExpression = 193,
SequenceExpression = 194,
String = 195,
TemplateString = 196,
TemplateSubstitution = 197,
Regex = 198,
MetaProperty = 199,
Arguments = 200,
Decorator = 201,
MemberExpression2 = 202,
CallExpression2 = 203,
ClassBody = 204,
PublicFieldDefinition = 205,
FormalParameters = 206,
RestParameter = 207,
MethodDefinition = 208,
Pair = 209,
PropertyName = 210,
ComputedPropertyName = 211,
ProgramRepeat1 = 212,
ExportStatementRepeat1 = 213,
ExportClauseRepeat1 = 214,
NamedImportsRepeat1 = 215,
VariableDeclarationRepeat1 = 216,
SwitchBodyRepeat1 = 217,
ObjectRepeat1 = 218,
ArrayRepeat1 = 219,
JsxElementRepeat1 = 220,
JsxOpeningElementRepeat1 = 221,
StringRepeat1 = 222,
StringRepeat2 = 223,
TemplateStringRepeat1 = 224,
ClassBodyRepeat1 = 225,
FormalParametersRepeat1 = 226,
ArrayPattern = 227,
ExportSpecifier = 228,
ImportSpecifier = 229,
ObjectPattern = 230,
PropertyIdentifier = 231,
ShorthandPropertyIdentifier = 232,
StatementIdentifier = 233,
Error = 234,
}
impl Into<&'static str> for Mozjs {
fn into(self) -> &'static str {
match self {
Mozjs::End => "end",
Mozjs::Identifier => "identifier",
Mozjs::HashBangLine => "hash_bang_line",
Mozjs::Export => "export",
Mozjs::STAR => "*",
Mozjs::Default => "default",
Mozjs::LBRACE => "{",
Mozjs::COMMA => ",",
Mozjs::RBRACE => "}",
Mozjs::As => "as",
Mozjs::Import2 => "import",
Mozjs::From => "from",
Mozjs::Var => "var",
Mozjs::Let => "let",
Mozjs::Const => "const",
Mozjs::If => "if",
Mozjs::Else => "else",
Mozjs::Switch => "switch",
Mozjs::For => "for",
Mozjs::LPAREN => "(",
Mozjs::RPAREN => ")",
Mozjs::Await => "await",
Mozjs::In => "in",
Mozjs::Of => "of",
Mozjs::While => "while",
Mozjs::Do => "do",
Mozjs::Try => "try",
Mozjs::With => "with",
Mozjs::Break => "break",
Mozjs::Continue => "continue",
Mozjs::Debugger => "debugger",
Mozjs::Return => "return",
Mozjs::Throw => "throw",
Mozjs::SEMI => ";",
Mozjs::COLON => ":",
Mozjs::Case => "case",
Mozjs::Catch => "catch",
Mozjs::Finally => "finally",
Mozjs::Yield => "yield",
Mozjs::EQ => "=",
Mozjs::LBRACK => "[",
Mozjs::RBRACK => "]",
Mozjs::LT => "<",
Mozjs::GT => ">",
Mozjs::SLASH => "/",
Mozjs::JsxText => "jsx_text",
Mozjs::Identifier2 => "identifier",
Mozjs::DOT => ".",
Mozjs::Class2 => "class",
Mozjs::Extends => "extends",
Mozjs::Async => "async",
Mozjs::Function2 => "function",
Mozjs::EQGT => "=>",
Mozjs::New => "new",
Mozjs::PLUSEQ => "+=",
Mozjs::DASHEQ => "-=",
Mozjs::STAREQ => "*=",
Mozjs::SLASHEQ => "/=",
Mozjs::PERCENTEQ => "%=",
Mozjs::CARETEQ => "^=",
Mozjs::AMPEQ => "&=",
Mozjs::PIPEEQ => "|=",
Mozjs::GTGTEQ => ">>=",
Mozjs::GTGTGTEQ => ">>>=",
Mozjs::LTLTEQ => "<<=",
Mozjs::STARSTAREQ => "**=",
Mozjs::DOTDOTDOT => "...",
Mozjs::QMARK => "?",
Mozjs::AMPAMP => "&&",
Mozjs::PIPEPIPE => "||",
Mozjs::GTGT => ">>",
Mozjs::GTGTGT => ">>>",
Mozjs::LTLT => "<<",
Mozjs::AMP => "&",
Mozjs::CARET => "^",
Mozjs::PIPE => "|",
Mozjs::PLUS => "+",
Mozjs::DASH => "-",
Mozjs::PERCENT => "%",
Mozjs::STARSTAR => "**",
Mozjs::LTEQ => "<=",
Mozjs::EQEQ => "==",
Mozjs::EQEQEQ => "===",
Mozjs::BANGEQ => "!=",
Mozjs::BANGEQEQ => "!==",
Mozjs::GTEQ => ">=",
Mozjs::QMARKQMARK => "??",
Mozjs::Instanceof => "instanceof",
Mozjs::BANG => "!",
Mozjs::TILDE => "~",
Mozjs::Typeof => "typeof",
Mozjs::Void => "void",
Mozjs::Delete => "delete",
Mozjs::PLUSPLUS => "++",
Mozjs::DASHDASH => "--",
Mozjs::DQUOTE => "\"",
Mozjs::StringToken1 => "string_token1",
Mozjs::SQUOTE => "'",
Mozjs::StringToken2 => "string_token2",
Mozjs::EscapeSequence => "escape_sequence",
Mozjs::Comment => "comment",
Mozjs::BQUOTE => "`",
Mozjs::DOLLARLBRACE => "${",
Mozjs::SLASH2 => "/",
Mozjs::RegexPattern => "regex_pattern",
Mozjs::RegexFlags => "regex_flags",
Mozjs::Number => "number",
Mozjs::Target => "target",
Mozjs::This => "this",
Mozjs::Super => "super",
Mozjs::True => "true",
Mozjs::False => "false",
Mozjs::Null => "null",
Mozjs::Undefined => "undefined",
Mozjs::AT => "@",
Mozjs::Static => "static",
Mozjs::Get => "get",
Mozjs::Set => "set",
Mozjs::Preproc => "preproc",
Mozjs::AutomaticSemicolon => "_automatic_semicolon",
Mozjs::TemplateChars => "_template_chars",
Mozjs::Program => "program",
Mozjs::ExportStatement => "export_statement",
Mozjs::ExportClause => "export_clause",
Mozjs::ImportExportSpecifier => "_import_export_specifier",
Mozjs::Declaration => "_declaration",
Mozjs::Import => "import",
Mozjs::ImportStatement => "import_statement",
Mozjs::ImportClause => "import_clause",
Mozjs::FromClause => "_from_clause",
Mozjs::NamespaceImport => "namespace_import",
Mozjs::NamedImports => "named_imports",
Mozjs::ExpressionStatement => "expression_statement",
Mozjs::VariableDeclaration => "variable_declaration",
Mozjs::LexicalDeclaration => "lexical_declaration",
Mozjs::VariableDeclarator => "variable_declarator",
Mozjs::StatementBlock => "statement_block",
Mozjs::IfStatement => "if_statement",
Mozjs::SwitchStatement => "switch_statement",
Mozjs::ForStatement => "for_statement",
Mozjs::ForInStatement => "for_in_statement",
Mozjs::ForHeader => "_for_header",
Mozjs::WhileStatement => "while_statement",
Mozjs::DoStatement => "do_statement",
Mozjs::TryStatement => "try_statement",
Mozjs::WithStatement => "with_statement",
Mozjs::BreakStatement => "break_statement",
Mozjs::ContinueStatement => "continue_statement",
Mozjs::DebuggerStatement => "debugger_statement",
Mozjs::ReturnStatement => "return_statement",
Mozjs::ThrowStatement => "throw_statement",
Mozjs::EmptyStatement => "empty_statement",
Mozjs::LabeledStatement => "labeled_statement",
Mozjs::SwitchBody => "switch_body",
Mozjs::SwitchCase => "switch_case",
Mozjs::SwitchDefault => "switch_default",
Mozjs::CatchClause => "catch_clause",
Mozjs::FinallyClause => "finally_clause",
Mozjs::ParenthesizedExpression => "parenthesized_expression",
Mozjs::Expression => "_expression",
Mozjs::YieldExpression => "yield_expression",
Mozjs::Object => "object",
Mozjs::AssignmentPattern => "assignment_pattern",
Mozjs::Array => "array",
Mozjs::JsxElement => "jsx_element",
Mozjs::JsxFragment => "jsx_fragment",
Mozjs::JsxExpression => "jsx_expression",
Mozjs::JsxOpeningElement => "jsx_opening_element",
Mozjs::NestedIdentifier => "nested_identifier",
Mozjs::JsxNamespaceName => "jsx_namespace_name",
Mozjs::JsxClosingElement => "jsx_closing_element",
Mozjs::JsxSelfClosingElement => "jsx_self_closing_element",
Mozjs::JsxAttribute => "jsx_attribute",
Mozjs::Class => "class",
Mozjs::ClassDeclaration => "class_declaration",
Mozjs::ClassHeritage => "class_heritage",
Mozjs::Function => "function",
Mozjs::FunctionDeclaration => "function_declaration",
Mozjs::GeneratorFunction => "generator_function",
Mozjs::GeneratorFunctionDeclaration => "generator_function_declaration",
Mozjs::ArrowFunction => "arrow_function",
Mozjs::CallExpression => "call_expression",
Mozjs::NewExpression => "new_expression",
Mozjs::AwaitExpression => "await_expression",
Mozjs::MemberExpression => "member_expression",
Mozjs::SubscriptExpression => "subscript_expression",
Mozjs::AssignmentExpression => "assignment_expression",
Mozjs::AugmentedAssignmentExpression => "augmented_assignment_expression",
Mozjs::Initializer => "_initializer",
Mozjs::SpreadElement => "spread_element",
Mozjs::TernaryExpression => "ternary_expression",
Mozjs::BinaryExpression => "binary_expression",
Mozjs::UnaryExpression => "unary_expression",
Mozjs::UpdateExpression => "update_expression",
Mozjs::SequenceExpression => "sequence_expression",
Mozjs::String => "string",
Mozjs::TemplateString => "template_string",
Mozjs::TemplateSubstitution => "template_substitution",
Mozjs::Regex => "regex",
Mozjs::MetaProperty => "meta_property",
Mozjs::Arguments => "arguments",
Mozjs::Decorator => "decorator",
Mozjs::MemberExpression2 => "member_expression",
Mozjs::CallExpression2 => "call_expression",
Mozjs::ClassBody => "class_body",
Mozjs::PublicFieldDefinition => "public_field_definition",
Mozjs::FormalParameters => "formal_parameters",
Mozjs::RestParameter => "rest_parameter",
Mozjs::MethodDefinition => "method_definition",
Mozjs::Pair => "pair",
Mozjs::PropertyName => "_property_name",
Mozjs::ComputedPropertyName => "computed_property_name",
Mozjs::ProgramRepeat1 => "program_repeat1",
Mozjs::ExportStatementRepeat1 => "export_statement_repeat1",
Mozjs::ExportClauseRepeat1 => "export_clause_repeat1",
Mozjs::NamedImportsRepeat1 => "named_imports_repeat1",
Mozjs::VariableDeclarationRepeat1 => "variable_declaration_repeat1",
Mozjs::SwitchBodyRepeat1 => "switch_body_repeat1",
Mozjs::ObjectRepeat1 => "object_repeat1",
Mozjs::ArrayRepeat1 => "array_repeat1",
Mozjs::JsxElementRepeat1 => "jsx_element_repeat1",
Mozjs::JsxOpeningElementRepeat1 => "jsx_opening_element_repeat1",
Mozjs::StringRepeat1 => "string_repeat1",
Mozjs::StringRepeat2 => "string_repeat2",
Mozjs::TemplateStringRepeat1 => "template_string_repeat1",
Mozjs::ClassBodyRepeat1 => "class_body_repeat1",
Mozjs::FormalParametersRepeat1 => "formal_parameters_repeat1",
Mozjs::ArrayPattern => "array_pattern",
Mozjs::ExportSpecifier => "export_specifier",
Mozjs::ImportSpecifier => "import_specifier",
Mozjs::ObjectPattern => "object_pattern",
Mozjs::PropertyIdentifier => "property_identifier",
Mozjs::ShorthandPropertyIdentifier => "shorthand_property_identifier",
Mozjs::StatementIdentifier => "statement_identifier",
Mozjs::Error => "ERROR",
}
}
}
#[allow(clippy::unreadable_literal)]
static KEYS: phf::Map<&'static str, Mozjs> = ::phf::Map {
key: 3213172566270843353,
disps: ::phf::Slice::Static(&[
(0, 1),
(0, 21),
(0, 13),
(5, 76),
(0, 16),
(0, 43),
(0, 5),
(0, 0),
(3, 185),
(7, 194),
(2, 186),
(0, 2),
(0, 2),
(14, 15),
(0, 104),
(0, 3),
(21, 104),
(0, 142),
(0, 0),
(2, 60),
(0, 26),
(0, 0),
(0, 9),
(0, 168),
(4, 114),
(0, 14),
(12, 71),
(0, 1),
(1, 11),
(0, 6),
(0, 49),
(6, 27),
(25, 223),
(1, 84),
(1, 0),
(0, 82),
(1, 0),
(0, 18),
(0, 56),
(0, 189),
(38, 151),
(7, 130),
(0, 7),
(0, 11),
(2, 3),
(0, 205),
]),
entries: ::phf::Slice::Static(&[
("_import_export_specifier", Mozjs::ImportExportSpecifier),
("class_body_repeat1", Mozjs::ClassBodyRepeat1),
("get", Mozjs::Get),
("&=", Mozjs::AMPEQ),
("-=", Mozjs::DASHEQ),
(">>=", Mozjs::GTGTEQ),
("for_in_statement", Mozjs::ForInStatement),
("(", Mozjs::LPAREN),
("import_clause", Mozjs::ImportClause),
("object", Mozjs::Object),
("var", Mozjs::Var),
("extends", Mozjs::Extends),
("variable_declaration", Mozjs::VariableDeclaration),
("empty_statement", Mozjs::EmptyStatement),
("true", Mozjs::True),
("<<=", Mozjs::LTLTEQ),
("undefined", Mozjs::Undefined),
("from", Mozjs::From),
("=", Mozjs::EQ),
("formal_parameters", Mozjs::FormalParameters),
("target", Mozjs::Target),
("in", Mozjs::In),
("&", Mozjs::AMP),
("while", Mozjs::While),
("object_pattern", Mozjs::ObjectPattern),
(",", Mozjs::COMMA),
("import_statement", Mozjs::ImportStatement),
("[", Mozjs::LBRACK),
("!=", Mozjs::BANGEQ),
("case", Mozjs::Case),
("-", Mozjs::DASH),
(">>>", Mozjs::GTGTGT),
("!==", Mozjs::BANGEQEQ),
("switch_body", Mozjs::SwitchBody),
("break", Mozjs::Break),
("regex_flags", Mozjs::RegexFlags),
("finally_clause", Mozjs::FinallyClause),
("class_body", Mozjs::ClassBody),
("||", Mozjs::PIPEPIPE),
("labeled_statement", Mozjs::LabeledStatement),
("string_token2", Mozjs::StringToken2),
("jsx_namespace_name", Mozjs::JsxNamespaceName),
("*", Mozjs::STAR),
("decorator", Mozjs::Decorator),
("ternary_expression", Mozjs::TernaryExpression),
("<=", Mozjs::LTEQ),
("object_repeat1", Mozjs::ObjectRepeat1),
("jsx_text", Mozjs::JsxText),
("binary_expression", Mozjs::BinaryExpression),
("&&", Mozjs::AMPAMP),
("try", Mozjs::Try),
("finally", Mozjs::Finally),
("_expression", Mozjs::Expression),
("super", Mozjs::Super),
("_from_clause", Mozjs::FromClause),
("continue", Mozjs::Continue),
("\'", Mozjs::SQUOTE),
("@", Mozjs::AT),
("_declaration", Mozjs::Declaration),
("continue_statement", Mozjs::ContinueStatement),
("debugger_statement", Mozjs::DebuggerStatement),
("arguments", Mozjs::Arguments),
("arrow_function", Mozjs::ArrowFunction),
("import", Mozjs::Import),
("function_declaration", Mozjs::FunctionDeclaration),
("jsx_element", Mozjs::JsxElement),
("switch_body_repeat1", Mozjs::SwitchBodyRepeat1),
("array_pattern", Mozjs::ArrayPattern),
("statement_identifier", Mozjs::StatementIdentifier),
("meta_property", Mozjs::MetaProperty),
("catch_clause", Mozjs::CatchClause),
("computed_property_name", Mozjs::ComputedPropertyName),
("^", Mozjs::CARET),
("for_statement", Mozjs::ForStatement),
("++", Mozjs::PLUSPLUS),
("array_repeat1", Mozjs::ArrayRepeat1),
("string_repeat1", Mozjs::StringRepeat1),
("export_specifier", Mozjs::ExportSpecifier),
("_template_chars", Mozjs::TemplateChars),
("spread_element", Mozjs::SpreadElement),
("do", Mozjs::Do),
("\\\"", Mozjs::DQUOTE),
("assignment_pattern", Mozjs::AssignmentPattern),
("end", Mozjs::End),
("==", Mozjs::EQEQ),
("jsx_self_closing_element", Mozjs::JsxSelfClosingElement),
("preproc", Mozjs::Preproc),
(">=", Mozjs::GTEQ),
("<", Mozjs::LT),
("identifier", Mozjs::Identifier),
("yield", Mozjs::Yield),
("export_statement", Mozjs::ExportStatement),
("public_field_definition", Mozjs::PublicFieldDefinition),
("nested_identifier", Mozjs::NestedIdentifier),
("class", Mozjs::Class),
("const", Mozjs::Const),
("number", Mozjs::Number),
("${", Mozjs::DOLLARLBRACE),
("null", Mozjs::Null),
("property_identifier", Mozjs::PropertyIdentifier),
("jsx_fragment", Mozjs::JsxFragment),
("class_declaration", Mozjs::ClassDeclaration),
("string", Mozjs::String),
("throw_statement", Mozjs::ThrowStatement),
(">", Mozjs::GT),
("delete", Mozjs::Delete),
(
"shorthand_property_identifier",
Mozjs::ShorthandPropertyIdentifier,
),
("update_expression", Mozjs::UpdateExpression),
("return", Mozjs::Return),
("call_expression", Mozjs::CallExpression),
("await_expression", Mozjs::AwaitExpression),
("~", Mozjs::TILDE),
(";", Mozjs::SEMI),
("program_repeat1", Mozjs::ProgramRepeat1),
("jsx_attribute", Mozjs::JsxAttribute),
("do_statement", Mozjs::DoStatement),
("typeof", Mozjs::Typeof),
(
"jsx_opening_element_repeat1",
Mozjs::JsxOpeningElementRepeat1,
),
("=>", Mozjs::EQGT),
("if", Mozjs::If),
("ERROR", Mozjs::Error),
("function", Mozjs::Function),
("escape_sequence", Mozjs::EscapeSequence),
("named_imports", Mozjs::NamedImports),
("hash_bang_line", Mozjs::HashBangLine),
("switch_statement", Mozjs::SwitchStatement),
("export", Mozjs::Export),
("template_substitution", Mozjs::TemplateSubstitution),
("%", Mozjs::PERCENT),
("regex_pattern", Mozjs::RegexPattern),
(">>>=", Mozjs::GTGTGTEQ),
("new", Mozjs::New),
("`", Mozjs::BQUOTE),
("with_statement", Mozjs::WithStatement),
("%=", Mozjs::PERCENTEQ),
("instanceof", Mozjs::Instanceof),
("set", Mozjs::Set),
("export_clause", Mozjs::ExportClause),
("with", Mozjs::With),
("member_expression", Mozjs::MemberExpression),
("export_statement_repeat1", Mozjs::ExportStatementRepeat1),
("**", Mozjs::STARSTAR),
("of", Mozjs::Of),
("as", Mozjs::As),
(")", Mozjs::RPAREN),
("unary_expression", Mozjs::UnaryExpression),
("void", Mozjs::Void),
("false", Mozjs::False),
("string_repeat2", Mozjs::StringRepeat2),
("switch", Mozjs::Switch),
("--", Mozjs::DASHDASH),
("while_statement", Mozjs::WhileStatement),
("import_specifier", Mozjs::ImportSpecifier),
("export_clause_repeat1", Mozjs::ExportClauseRepeat1),
("try_statement", Mozjs::TryStatement),
("+", Mozjs::PLUS),
("===", Mozjs::EQEQEQ),
("rest_parameter", Mozjs::RestParameter),
("{", Mozjs::LBRACE),
("sequence_expression", Mozjs::SequenceExpression),
("*=", Mozjs::STAREQ),
(
"generator_function_declaration",
Mozjs::GeneratorFunctionDeclaration,
),
("jsx_opening_element", Mozjs::JsxOpeningElement),
("variable_declarator", Mozjs::VariableDeclarator),
("for", Mozjs::For),
("??", Mozjs::QMARKQMARK),
("...", Mozjs::DOTDOTDOT),
("**=", Mozjs::STARSTAREQ),
("jsx_element_repeat1", Mozjs::JsxElementRepeat1),
("}", Mozjs::RBRACE),
("generator_function", Mozjs::GeneratorFunction),
("switch_default", Mozjs::SwitchDefault),
("jsx_closing_element", Mozjs::JsxClosingElement),
("named_imports_repeat1", Mozjs::NamedImportsRepeat1),
("^=", Mozjs::CARETEQ),
("yield_expression", Mozjs::YieldExpression),
("|", Mozjs::PIPE),
("regex", Mozjs::Regex),
("string_token1", Mozjs::StringToken1),
("program", Mozjs::Program),
(".", Mozjs::DOT),
("+=", Mozjs::PLUSEQ),
("?", Mozjs::QMARK),
("jsx_expression", Mozjs::JsxExpression),
("subscript_expression", Mozjs::SubscriptExpression),
("async", Mozjs::Async),
("_for_header", Mozjs::ForHeader),
("static", Mozjs::Static),
("class_heritage", Mozjs::ClassHeritage),
("catch", Mozjs::Catch),
("await", Mozjs::Await),
("formal_parameters_repeat1", Mozjs::FormalParametersRepeat1),
(">>", Mozjs::GTGT),
("template_string", Mozjs::TemplateString),
("return_statement", Mozjs::ReturnStatement),
("statement_block", Mozjs::StatementBlock),
("this", Mozjs::This),
("new_expression", Mozjs::NewExpression),
("switch_case", Mozjs::SwitchCase),
(
"augmented_assignment_expression",
Mozjs::AugmentedAssignmentExpression,
),
("expression_statement", Mozjs::ExpressionStatement),
("namespace_import", Mozjs::NamespaceImport),
("/=", Mozjs::SLASHEQ),
("_automatic_semicolon", Mozjs::AutomaticSemicolon),
("method_definition", Mozjs::MethodDefinition),
("debugger", Mozjs::Debugger),
("|=", Mozjs::PIPEEQ),
("_initializer", Mozjs::Initializer),
("break_statement", Mozjs::BreakStatement),
(":", Mozjs::COLON),
("array", Mozjs::Array),
("_property_name", Mozjs::PropertyName),
("if_statement", Mozjs::IfStatement),
("]", Mozjs::RBRACK),
("<<", Mozjs::LTLT),
("pair", Mozjs::Pair),
("/", Mozjs::SLASH),
("parenthesized_expression", Mozjs::ParenthesizedExpression),
("let", Mozjs::Let),
("default", Mozjs::Default),
(
"variable_declaration_repeat1",
Mozjs::VariableDeclarationRepeat1,
),
("throw", Mozjs::Throw),
("comment", Mozjs::Comment),
("template_string_repeat1", Mozjs::TemplateStringRepeat1),
("!", Mozjs::BANG),
("assignment_expression", Mozjs::AssignmentExpression),
("lexical_declaration", Mozjs::LexicalDeclaration),
("else", Mozjs::Else),
]),
};
impl From<&str> for Mozjs {
#[inline(always)]
fn from(key: &str) -> Self {
KEYS.get(key).unwrap().clone()
}
}
impl From<u16> for Mozjs {
#[inline(always)]
fn from(x: u16) -> Self {
unsafe { std::mem::transmute(x as u8) }
}
}
impl PartialEq<u16> for Mozjs {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Mozjs::from(*x)
}
}
impl PartialEq<Mozjs> for u16 {
#[inline(always)]
fn eq(&self, x: &Mozjs) -> bool {
*x == *self
}
}