Regenerate tree-sitter-mozjs grammar

This commit is contained in:
Luni-4 2021-03-16 13:33:07 +01:00
Родитель d0c1051aff
Коммит 237931a9f4
11 изменённых файлов: 50816 добавлений и 43401 удалений

Просмотреть файл

@ -167,81 +167,89 @@ pub enum Mozjs {
FinallyClause = 162,
ParenthesizedExpression = 163,
Expression = 164,
YieldExpression = 165,
Object = 166,
AssignmentPattern = 167,
Array = 168,
JsxElement = 169,
JsxFragment = 170,
JsxExpression = 171,
JsxOpeningElement = 172,
NestedIdentifier = 173,
JsxNamespaceName = 174,
JsxClosingElement = 175,
JsxSelfClosingElement = 176,
JsxAttribute = 177,
Class = 178,
ClassDeclaration = 179,
ClassHeritage = 180,
Function = 181,
FunctionDeclaration = 182,
GeneratorFunction = 183,
GeneratorFunctionDeclaration = 184,
ArrowFunction = 185,
CallExpression = 186,
NewExpression = 187,
AwaitExpression = 188,
MemberExpression = 189,
SubscriptExpression = 190,
AssignmentExpression = 191,
AugmentedAssignmentLhs = 192,
AugmentedAssignmentExpression = 193,
Initializer = 194,
SpreadElement = 195,
TernaryExpression = 196,
BinaryExpression = 197,
UnaryExpression = 198,
UpdateExpression = 199,
SequenceExpression = 200,
String = 201,
TemplateString = 202,
TemplateSubstitution = 203,
Regex = 204,
MetaProperty = 205,
Arguments = 206,
Decorator = 207,
MemberExpression2 = 208,
CallExpression2 = 209,
ClassBody = 210,
PublicFieldDefinition = 211,
FormalParameters = 212,
RestParameter = 213,
MethodDefinition = 214,
Pair = 215,
PropertyName = 216,
ComputedPropertyName = 217,
ProgramRepeat1 = 218,
ExportStatementRepeat1 = 219,
ExportClauseRepeat1 = 220,
NamedImportsRepeat1 = 221,
VariableDeclarationRepeat1 = 222,
SwitchBodyRepeat1 = 223,
ObjectRepeat1 = 224,
ArrayRepeat1 = 225,
JsxElementRepeat1 = 226,
JsxOpeningElementRepeat1 = 227,
StringRepeat1 = 228,
StringRepeat2 = 229,
TemplateStringRepeat1 = 230,
ClassBodyRepeat1 = 231,
FormalParametersRepeat1 = 232,
ArrayPattern = 233,
ImportSpecifier = 234,
ObjectPattern = 235,
PropertyIdentifier = 236,
ShorthandPropertyIdentifier = 237,
StatementIdentifier = 238,
Error = 239,
PrimaryExpression = 165,
YieldExpression = 166,
Object = 167,
ObjectPattern = 168,
AssignmentPattern = 169,
ObjectAssignmentPattern = 170,
Array = 171,
ArrayPattern = 172,
JsxElement = 173,
JsxFragment = 174,
JsxExpression = 175,
JsxOpeningElement = 176,
NestedIdentifier = 177,
JsxNamespaceName = 178,
JsxClosingElement = 179,
JsxSelfClosingElement = 180,
JsxAttribute = 181,
Class = 182,
ClassDeclaration = 183,
ClassHeritage = 184,
Function = 185,
FunctionDeclaration = 186,
GeneratorFunction = 187,
GeneratorFunctionDeclaration = 188,
ArrowFunction = 189,
CallExpression = 190,
NewExpression = 191,
AwaitExpression = 192,
MemberExpression = 193,
SubscriptExpression = 194,
AssignmentExpression = 195,
AugmentedAssignmentLhs = 196,
AugmentedAssignmentExpression = 197,
Initializer = 198,
DestructuringPattern = 199,
SpreadElement = 200,
TernaryExpression = 201,
BinaryExpression = 202,
UnaryExpression = 203,
UpdateExpression = 204,
SequenceExpression = 205,
String = 206,
TemplateString = 207,
TemplateSubstitution = 208,
Regex = 209,
MetaProperty = 210,
Arguments = 211,
Decorator = 212,
MemberExpression2 = 213,
CallExpression2 = 214,
ClassBody = 215,
PublicFieldDefinition = 216,
FormalParameters = 217,
Pattern = 218,
RestPattern = 219,
MethodDefinition = 220,
Pair = 221,
PairPattern = 222,
PropertyName = 223,
ComputedPropertyName = 224,
ProgramRepeat1 = 225,
ExportStatementRepeat1 = 226,
ExportClauseRepeat1 = 227,
NamedImportsRepeat1 = 228,
VariableDeclarationRepeat1 = 229,
SwitchBodyRepeat1 = 230,
ObjectRepeat1 = 231,
ObjectPatternRepeat1 = 232,
ArrayRepeat1 = 233,
ArrayPatternRepeat1 = 234,
JsxElementRepeat1 = 235,
JsxOpeningElementRepeat1 = 236,
StringRepeat1 = 237,
StringRepeat2 = 238,
TemplateStringRepeat1 = 239,
ClassBodyRepeat1 = 240,
FormalParametersRepeat1 = 241,
ImportSpecifier = 242,
PropertyIdentifier = 243,
ShorthandPropertyIdentifier = 244,
ShorthandPropertyIdentifierPattern = 245,
StatementIdentifier = 246,
Error = 247,
}
impl Into<&'static str> for Mozjs {
@ -376,7 +384,7 @@ impl Into<&'static str> for Mozjs {
Mozjs::ExportStatement => "export_statement",
Mozjs::ExportClause => "export_clause",
Mozjs::ExportSpecifier => "export_specifier",
Mozjs::Declaration => "_declaration",
Mozjs::Declaration => "declaration",
Mozjs::Import => "import",
Mozjs::ImportStatement => "import_statement",
Mozjs::ImportClause => "import_clause",
@ -411,11 +419,15 @@ impl Into<&'static str> for Mozjs {
Mozjs::CatchClause => "catch_clause",
Mozjs::FinallyClause => "finally_clause",
Mozjs::ParenthesizedExpression => "parenthesized_expression",
Mozjs::Expression => "_expression",
Mozjs::Expression => "expression",
Mozjs::PrimaryExpression => "primary_expression",
Mozjs::YieldExpression => "yield_expression",
Mozjs::Object => "object",
Mozjs::ObjectPattern => "object_pattern",
Mozjs::AssignmentPattern => "assignment_pattern",
Mozjs::ObjectAssignmentPattern => "object_assignment_pattern",
Mozjs::Array => "array",
Mozjs::ArrayPattern => "array_pattern",
Mozjs::JsxElement => "jsx_element",
Mozjs::JsxFragment => "jsx_fragment",
Mozjs::JsxExpression => "jsx_expression",
@ -442,6 +454,7 @@ impl Into<&'static str> for Mozjs {
Mozjs::AugmentedAssignmentLhs => "_augmented_assignment_lhs",
Mozjs::AugmentedAssignmentExpression => "augmented_assignment_expression",
Mozjs::Initializer => "_initializer",
Mozjs::DestructuringPattern => "_destructuring_pattern",
Mozjs::SpreadElement => "spread_element",
Mozjs::TernaryExpression => "ternary_expression",
Mozjs::BinaryExpression => "binary_expression",
@ -460,9 +473,11 @@ impl Into<&'static str> for Mozjs {
Mozjs::ClassBody => "class_body",
Mozjs::PublicFieldDefinition => "public_field_definition",
Mozjs::FormalParameters => "formal_parameters",
Mozjs::RestParameter => "rest_parameter",
Mozjs::Pattern => "pattern",
Mozjs::RestPattern => "rest_pattern",
Mozjs::MethodDefinition => "method_definition",
Mozjs::Pair => "pair",
Mozjs::PairPattern => "pair_pattern",
Mozjs::PropertyName => "_property_name",
Mozjs::ComputedPropertyName => "computed_property_name",
Mozjs::ProgramRepeat1 => "program_repeat1",
@ -472,7 +487,9 @@ impl Into<&'static str> for Mozjs {
Mozjs::VariableDeclarationRepeat1 => "variable_declaration_repeat1",
Mozjs::SwitchBodyRepeat1 => "switch_body_repeat1",
Mozjs::ObjectRepeat1 => "object_repeat1",
Mozjs::ObjectPatternRepeat1 => "object_pattern_repeat1",
Mozjs::ArrayRepeat1 => "array_repeat1",
Mozjs::ArrayPatternRepeat1 => "array_pattern_repeat1",
Mozjs::JsxElementRepeat1 => "jsx_element_repeat1",
Mozjs::JsxOpeningElementRepeat1 => "jsx_opening_element_repeat1",
Mozjs::StringRepeat1 => "string_repeat1",
@ -480,11 +497,10 @@ impl Into<&'static str> for Mozjs {
Mozjs::TemplateStringRepeat1 => "template_string_repeat1",
Mozjs::ClassBodyRepeat1 => "class_body_repeat1",
Mozjs::FormalParametersRepeat1 => "formal_parameters_repeat1",
Mozjs::ArrayPattern => "array_pattern",
Mozjs::ImportSpecifier => "import_specifier",
Mozjs::ObjectPattern => "object_pattern",
Mozjs::PropertyIdentifier => "property_identifier",
Mozjs::ShorthandPropertyIdentifier => "shorthand_property_identifier",
Mozjs::ShorthandPropertyIdentifierPattern => "shorthand_property_identifier_pattern",
Mozjs::StatementIdentifier => "statement_identifier",
Mozjs::Error => "ERROR",
}
@ -493,305 +509,318 @@ impl Into<&'static str> for Mozjs {
#[allow(clippy::unreadable_literal)]
static KEYS: phf::Map<&'static str, Mozjs> = ::phf::Map {
key: 3347381344252206323,
key: 3213172566270843353,
disps: ::phf::Slice::Static(&[
(0, 10),
(5, 82),
(1, 172),
(1, 132),
(1, 51),
(0, 115),
(0, 53),
(0, 1),
(0, 72),
(0, 17),
(2, 1),
(1, 214),
(0, 1),
(0, 84),
(0, 195),
(7, 123),
(0, 62),
(0, 6),
(0, 46),
(0, 24),
(0, 60),
(4, 22),
(2, 67),
(0, 16),
(0, 8),
(30, 182),
(5, 55),
(0, 10),
(0, 83),
(3, 128),
(0, 189),
(0, 70),
(0, 36),
(0, 224),
(1, 0),
(0, 57),
(0, 13),
(0, 11),
(1, 2),
(2, 5),
(0, 4),
(2, 0),
(0, 195),
(1, 47),
(0, 6),
(0, 0),
(0, 31),
(3, 162),
(0, 29),
(7, 182),
(2, 191),
(0, 120),
(24, 35),
(0, 155),
(4, 62),
(0, 35),
(4, 151),
(29, 129),
(0, 31),
(22, 120),
(0, 31),
(0, 3),
(0, 23),
(11, 45),
(0, 5),
(0, 15),
(0, 56),
(28, 84),
(0, 2),
(9, 161),
(1, 18),
(0, 79),
(60, 226),
(4, 212),
(0, 10),
(2, 181),
(0, 4),
(1, 41),
(0, 16),
(0, 38),
(0, 24),
(36, 8),
(0, 0),
(1, 169),
(0, 7),
(0, 36),
(2, 24),
(0, 0),
(0, 39),
(1, 11),
(1, 204),
]),
entries: ::phf::Slice::Static(&[
("new", Mozjs::New),
("switch_statement", Mozjs::SwitchStatement),
("string_token1", Mozjs::StringToken1),
("of", Mozjs::Of),
("try_statement", Mozjs::TryStatement),
("<<=", Mozjs::LTLTEQ),
(
"augmented_assignment_expression",
Mozjs::AugmentedAssignmentExpression,
),
("formal_parameters_repeat1", Mozjs::FormalParametersRepeat1),
("class_declaration", Mozjs::ClassDeclaration),
("target", Mozjs::Target),
("|=", Mozjs::PIPEEQ),
("jsx_closing_element", Mozjs::JsxClosingElement),
("/", Mozjs::SLASH),
("%=", Mozjs::PERCENTEQ),
(">>=", Mozjs::GTGTEQ),
("import_specifier", Mozjs::ImportSpecifier),
("finally", Mozjs::Finally),
("??", Mozjs::QMARKQMARK),
("do", Mozjs::Do),
("yield", Mozjs::Yield),
("class_heritage", Mozjs::ClassHeritage),
("await", Mozjs::Await),
("import", Mozjs::Import),
("array_pattern", Mozjs::ArrayPattern),
("arrow_function", Mozjs::ArrowFunction),
("async", Mozjs::Async),
("string", Mozjs::String),
("class_body_repeat1", Mozjs::ClassBodyRepeat1),
(".", Mozjs::DOT),
("number", Mozjs::Number),
("class_body", Mozjs::ClassBody),
("await_expression", Mozjs::AwaitExpression),
("spread_element", Mozjs::SpreadElement),
("=", Mozjs::EQ),
("formal_parameters", Mozjs::FormalParameters),
("&&", Mozjs::AMPAMP),
("for", Mozjs::For),
("method_definition", Mozjs::MethodDefinition),
("`", Mozjs::BQUOTE),
("true", Mozjs::True),
("nested_identifier", Mozjs::NestedIdentifier),
("if", Mozjs::If),
("set", Mozjs::Set),
("--", Mozjs::DASHDASH),
("do_statement", Mozjs::DoStatement),
("*", Mozjs::STAR),
("pair", Mozjs::Pair),
("+", Mozjs::PLUS),
("return", Mozjs::Return),
("_expression", Mozjs::Expression),
("jsx_text", Mozjs::JsxText),
("switch_default", Mozjs::SwitchDefault),
("property_identifier", Mozjs::PropertyIdentifier),
("...", Mozjs::DOTDOTDOT),
("template_substitution", Mozjs::TemplateSubstitution),
("_automatic_semicolon", Mozjs::AutomaticSemicolon),
("throw_statement", Mozjs::ThrowStatement),
("variable_declarator", Mozjs::VariableDeclarator),
("export_statement_repeat1", Mozjs::ExportStatementRepeat1),
("throw", Mozjs::Throw),
("&&=", Mozjs::AMPAMPEQ),
("-", Mozjs::DASH),
("catch_clause", Mozjs::CatchClause),
("meta_property", Mozjs::MetaProperty),
("in", Mozjs::In),
("try", Mozjs::Try),
("jsx_element_repeat1", Mozjs::JsxElementRepeat1),
(")", Mozjs::RPAREN),
("end", Mozjs::End),
("${", Mozjs::DOLLARLBRACE),
("empty_statement", Mozjs::EmptyStatement),
("statement_block", Mozjs::StatementBlock),
(">>", Mozjs::GTGT),
("named_imports_repeat1", Mozjs::NamedImportsRepeat1),
("debugger_statement", Mozjs::DebuggerStatement),
("statement_identifier", Mozjs::StatementIdentifier),
("computed_property_name", Mozjs::ComputedPropertyName),
("_template_chars", Mozjs::TemplateChars),
("identifier", Mozjs::Identifier),
("variable_declaration", Mozjs::VariableDeclaration),
("continue", Mozjs::Continue),
("with", Mozjs::With),
(">>>", Mozjs::GTGTGT),
("string_token2", Mozjs::StringToken2),
("\\\"", Mozjs::DQUOTE),
("as", Mozjs::As),
("assignment_expression", Mozjs::AssignmentExpression),
("||", Mozjs::PIPEPIPE),
("!", Mozjs::BANG),
("while", Mozjs::While),
("false", Mozjs::False),
("!==", Mozjs::BANGEQEQ),
("return_statement", Mozjs::ReturnStatement),
("export", Mozjs::Export),
("member_expression", Mozjs::MemberExpression),
("regex_flags", Mozjs::RegexFlags),
("void", Mozjs::Void),
("??=", Mozjs::QMARKQMARKEQ),
("this", Mozjs::This),
("expression_statement", Mozjs::ExpressionStatement),
("assignment_pattern", Mozjs::AssignmentPattern),
("=>", Mozjs::EQGT),
("else", Mozjs::Else),
("instanceof", Mozjs::Instanceof),
("regex", Mozjs::Regex),
("ERROR", Mozjs::Error),
("typeof", Mozjs::Typeof),
("<=", Mozjs::LTEQ),
("continue_statement", Mozjs::ContinueStatement),
("ternary_expression", Mozjs::TernaryExpression),
("export_clause_repeat1", Mozjs::ExportClauseRepeat1),
("from", Mozjs::From),
("object_pattern", Mozjs::ObjectPattern),
("_augmented_assignment_lhs", Mozjs::AugmentedAssignmentLhs),
("[", Mozjs::LBRACK),
("function", Mozjs::Function),
("case", Mozjs::Case),
("jsx_self_closing_element", Mozjs::JsxSelfClosingElement),
("**", Mozjs::STARSTAR),
("function_declaration", Mozjs::FunctionDeclaration),
(":", Mozjs::COLON),
("<<", Mozjs::LTLT),
("string_repeat2", Mozjs::StringRepeat2),
("else_clause", Mozjs::ElseClause),
("_for_header", Mozjs::ForHeader),
("default", Mozjs::Default),
("for_in_statement", Mozjs::ForInStatement),
("jsx_fragment", Mozjs::JsxFragment),
("named_imports", Mozjs::NamedImports),
("preproc", Mozjs::Preproc),
("lexical_declaration", Mozjs::LexicalDeclaration),
("undefined", Mozjs::Undefined),
("\'", Mozjs::SQUOTE),
("switch_body", Mozjs::SwitchBody),
("++", Mozjs::PLUSPLUS),
("array", Mozjs::Array),
("_initializer", Mozjs::Initializer),
("with_statement", Mozjs::WithStatement),
("binary_expression", Mozjs::BinaryExpression),
(",", Mozjs::COMMA),
("(", Mozjs::LPAREN),
("switch_case", Mozjs::SwitchCase),
("escape_sequence", Mozjs::EscapeSequence),
("labeled_statement", Mozjs::LabeledStatement),
("array_repeat1", Mozjs::ArrayRepeat1),
("jsx_element", Mozjs::JsxElement),
("static", Mozjs::Static),
("call_expression", Mozjs::CallExpression),
("super", Mozjs::Super),
("{", Mozjs::LBRACE),
("new_expression", Mozjs::NewExpression),
("template_string_repeat1", Mozjs::TemplateStringRepeat1),
("object_repeat1", Mozjs::ObjectRepeat1),
("/=", Mozjs::SLASHEQ),
("subscript_expression", Mozjs::SubscriptExpression),
("|", Mozjs::PIPE),
("import_clause", Mozjs::ImportClause),
("import_statement", Mozjs::ImportStatement),
("yield_expression", Mozjs::YieldExpression),
(
"generator_function_declaration",
Mozjs::GeneratorFunctionDeclaration,
),
("while_statement", Mozjs::WhileStatement),
("jsx_opening_element", Mozjs::JsxOpeningElement),
(">>>=", Mozjs::GTGTGTEQ),
("jsx_attribute", Mozjs::JsxAttribute),
("delete", Mozjs::Delete),
("hash_bang_line", Mozjs::HashBangLine),
("export_clause", Mozjs::ExportClause),
("break_statement", Mozjs::BreakStatement),
("+=", Mozjs::PLUSEQ),
("var", Mozjs::Var),
("program_repeat1", Mozjs::ProgramRepeat1),
("extends", Mozjs::Extends),
("get", Mozjs::Get),
("?.", Mozjs::QMARKDOT),
("let", Mozjs::Let),
("string_repeat1", Mozjs::StringRepeat1),
("_from_clause", Mozjs::FromClause),
("jsx_expression", Mozjs::JsxExpression),
("object", Mozjs::Object),
("const", Mozjs::Const),
("-=", Mozjs::DASHEQ),
("break", Mozjs::Break),
("*=", Mozjs::STAREQ),
("<", Mozjs::LT),
("program", Mozjs::Program),
("_property_name", Mozjs::PropertyName),
(">=", Mozjs::GTEQ),
("^=", Mozjs::CARETEQ),
("==", Mozjs::EQEQ),
("jsx_namespace_name", Mozjs::JsxNamespaceName),
(
"shorthand_property_identifier",
Mozjs::ShorthandPropertyIdentifier,
),
("===", Mozjs::EQEQEQ),
("switch_body_repeat1", Mozjs::SwitchBodyRepeat1),
("debugger", Mozjs::Debugger),
("rest_parameter", Mozjs::RestParameter),
("for_statement", Mozjs::ForStatement),
("**=", Mozjs::STARSTAREQ),
("?", Mozjs::QMARK),
("unary_expression", Mozjs::UnaryExpression),
("&", Mozjs::AMP),
("parenthesized_expression", Mozjs::ParenthesizedExpression),
("generator_function", Mozjs::GeneratorFunction),
("switch", Mozjs::Switch),
("export_specifier", Mozjs::ExportSpecifier),
("template_string", Mozjs::TemplateString),
("null", Mozjs::Null),
("_declaration", Mozjs::Declaration),
("if_statement", Mozjs::IfStatement),
("@", Mozjs::AT),
("regex_pattern", Mozjs::RegexPattern),
("update_expression", Mozjs::UpdateExpression),
(";", Mozjs::SEMI),
("public_field_definition", Mozjs::PublicFieldDefinition),
("%", Mozjs::PERCENT),
(">", Mozjs::GT),
("namespace_import", Mozjs::NamespaceImport),
("arguments", Mozjs::Arguments),
("+", Mozjs::PLUS),
("string_repeat1", Mozjs::StringRepeat1),
(
"variable_declaration_repeat1",
Mozjs::VariableDeclarationRepeat1,
"generator_function_declaration",
Mozjs::GeneratorFunctionDeclaration,
),
("||=", Mozjs::PIPEPIPEEQ),
("expression_statement", Mozjs::ExpressionStatement),
("jsx_expression", Mozjs::JsxExpression),
("...", Mozjs::DOTDOTDOT),
("escape_sequence", Mozjs::EscapeSequence),
("]", Mozjs::RBRACK),
("comment", Mozjs::Comment),
("class", Mozjs::Class),
("}", Mozjs::RBRACE),
("export_statement_repeat1", Mozjs::ExportStatementRepeat1),
("string_token2", Mozjs::StringToken2),
("undefined", Mozjs::Undefined),
("template_string_repeat1", Mozjs::TemplateStringRepeat1),
("named_imports_repeat1", Mozjs::NamedImportsRepeat1),
("return_statement", Mozjs::ReturnStatement),
("if", Mozjs::If),
("typeof", Mozjs::Typeof),
("from", Mozjs::From),
("declaration", Mozjs::Declaration),
("named_imports", Mozjs::NamedImports),
("-=", Mozjs::DASHEQ),
("throw_statement", Mozjs::ThrowStatement),
("meta_property", Mozjs::MetaProperty),
("export", Mozjs::Export),
(">>>", Mozjs::GTGTGT),
(">", Mozjs::GT),
("import_clause", Mozjs::ImportClause),
("array_pattern_repeat1", Mozjs::ArrayPatternRepeat1),
("var", Mozjs::Var),
("binary_expression", Mozjs::BinaryExpression),
("string", Mozjs::String),
("ternary_expression", Mozjs::TernaryExpression),
(
"shorthand_property_identifier_pattern",
Mozjs::ShorthandPropertyIdentifierPattern,
),
("=>", Mozjs::EQGT),
("**", Mozjs::STARSTAR),
("|", Mozjs::PIPE),
("for_statement", Mozjs::ForStatement),
("throw", Mozjs::Throw),
(
"augmented_assignment_expression",
Mozjs::AugmentedAssignmentExpression,
),
("void", Mozjs::Void),
("public_field_definition", Mozjs::PublicFieldDefinition),
("for", Mozjs::For),
("preproc", Mozjs::Preproc),
("[", Mozjs::LBRACK),
("unary_expression", Mozjs::UnaryExpression),
("pair_pattern", Mozjs::PairPattern),
(".", Mozjs::DOT),
("_property_name", Mozjs::PropertyName),
("parenthesized_expression", Mozjs::ParenthesizedExpression),
("array_repeat1", Mozjs::ArrayRepeat1),
("switch_body_repeat1", Mozjs::SwitchBodyRepeat1),
("array_pattern", Mozjs::ArrayPattern),
("number", Mozjs::Number),
("class_heritage", Mozjs::ClassHeritage),
("labeled_statement", Mozjs::LabeledStatement),
("||", Mozjs::PIPEPIPE),
("regex", Mozjs::Regex),
("~", Mozjs::TILDE),
("^", Mozjs::CARET),
("catch", Mozjs::Catch),
("export_statement", Mozjs::ExportStatement),
("decorator", Mozjs::Decorator),
("finally_clause", Mozjs::FinallyClause),
("!=", Mozjs::BANGEQ),
("&=", Mozjs::AMPEQ),
("sequence_expression", Mozjs::SequenceExpression),
(
"jsx_opening_element_repeat1",
Mozjs::JsxOpeningElementRepeat1,
),
("import_specifier", Mozjs::ImportSpecifier),
("this", Mozjs::This),
("switch", Mozjs::Switch),
("^=", Mozjs::CARETEQ),
("empty_statement", Mozjs::EmptyStatement),
("array", Mozjs::Array),
("continue_statement", Mozjs::ContinueStatement),
("<<", Mozjs::LTLT),
("!=", Mozjs::BANGEQ),
("`", Mozjs::BQUOTE),
("<<=", Mozjs::LTLTEQ),
("=", Mozjs::EQ),
(">>=", Mozjs::GTGTEQ),
("assignment_pattern", Mozjs::AssignmentPattern),
("==", Mozjs::EQEQ),
("debugger", Mozjs::Debugger),
("generator_function", Mozjs::GeneratorFunction),
("in", Mozjs::In),
("static", Mozjs::Static),
("^", Mozjs::CARET),
("%=", Mozjs::PERCENTEQ),
("for_in_statement", Mozjs::ForInStatement),
("finally", Mozjs::Finally),
("else", Mozjs::Else),
("jsx_attribute", Mozjs::JsxAttribute),
("catch", Mozjs::Catch),
("_for_header", Mozjs::ForHeader),
("object_pattern", Mozjs::ObjectPattern),
("null", Mozjs::Null),
("string_token1", Mozjs::StringToken1),
("break_statement", Mozjs::BreakStatement),
("instanceof", Mozjs::Instanceof),
("regex_flags", Mozjs::RegexFlags),
("finally_clause", Mozjs::FinallyClause),
("!==", Mozjs::BANGEQEQ),
("*", Mozjs::STAR),
("export_specifier", Mozjs::ExportSpecifier),
("nested_identifier", Mozjs::NestedIdentifier),
("jsx_fragment", Mozjs::JsxFragment),
("break", Mozjs::Break),
("class_body_repeat1", Mozjs::ClassBodyRepeat1),
("method_definition", Mozjs::MethodDefinition),
("jsx_text", Mozjs::JsxText),
("|=", Mozjs::PIPEEQ),
("member_expression", Mozjs::MemberExpression),
("extends", Mozjs::Extends),
("continue", Mozjs::Continue),
("jsx_opening_element", Mozjs::JsxOpeningElement),
("export_clause_repeat1", Mozjs::ExportClauseRepeat1),
("lexical_declaration", Mozjs::LexicalDeclaration),
("await", Mozjs::Await),
("}", Mozjs::RBRACE),
("${", Mozjs::DOLLARLBRACE),
("<", Mozjs::LT),
("jsx_self_closing_element", Mozjs::JsxSelfClosingElement),
("async", Mozjs::Async),
("update_expression", Mozjs::UpdateExpression),
("sequence_expression", Mozjs::SequenceExpression),
("jsx_closing_element", Mozjs::JsxClosingElement),
("&", Mozjs::AMP),
("formal_parameters", Mozjs::FormalParameters),
("program", Mozjs::Program),
("decorator", Mozjs::Decorator),
("function", Mozjs::Function),
("import", Mozjs::Import),
("function_declaration", Mozjs::FunctionDeclaration),
("catch_clause", Mozjs::CatchClause),
("regex_pattern", Mozjs::RegexPattern),
("_initializer", Mozjs::Initializer),
("as", Mozjs::As),
("template_substitution", Mozjs::TemplateSubstitution),
("computed_property_name", Mozjs::ComputedPropertyName),
("variable_declaration", Mozjs::VariableDeclaration),
("/=", Mozjs::SLASHEQ),
("yield", Mozjs::Yield),
("&&", Mozjs::AMPAMP),
("new", Mozjs::New),
("object", Mozjs::Object),
("--", Mozjs::DASHDASH),
("property_identifier", Mozjs::PropertyIdentifier),
("default", Mozjs::Default),
("?.", Mozjs::QMARKDOT),
("expression", Mozjs::Expression),
("??=", Mozjs::QMARKQMARKEQ),
("string_repeat2", Mozjs::StringRepeat2),
("return", Mozjs::Return),
("while", Mozjs::While),
("===", Mozjs::EQEQEQ),
(">>", Mozjs::GTGT),
("_augmented_assignment_lhs", Mozjs::AugmentedAssignmentLhs),
("with_statement", Mozjs::WithStatement),
("of", Mozjs::Of),
("&=", Mozjs::AMPEQ),
("_destructuring_pattern", Mozjs::DestructuringPattern),
("&&=", Mozjs::AMPAMPEQ),
("-", Mozjs::DASH),
("_from_clause", Mozjs::FromClause),
("*=", Mozjs::STAREQ),
("const", Mozjs::Const),
("comment", Mozjs::Comment),
("identifier", Mozjs::Identifier),
(":", Mozjs::COLON),
("let", Mozjs::Let),
(">=", Mozjs::GTEQ),
("switch_case", Mozjs::SwitchCase),
("switch_statement", Mozjs::SwitchStatement),
("jsx_namespace_name", Mozjs::JsxNamespaceName),
(",", Mozjs::COMMA),
(")", Mozjs::RPAREN),
("with", Mozjs::With),
("\'", Mozjs::SQUOTE),
("false", Mozjs::False),
("variable_declarator", Mozjs::VariableDeclarator),
("ERROR", Mozjs::Error),
(
"variable_declaration_repeat1",
Mozjs::VariableDeclarationRepeat1,
),
("primary_expression", Mozjs::PrimaryExpression),
("@", Mozjs::AT),
("pair", Mozjs::Pair),
("await_expression", Mozjs::AwaitExpression),
("jsx_element_repeat1", Mozjs::JsxElementRepeat1),
("true", Mozjs::True),
("switch_body", Mozjs::SwitchBody),
("yield_expression", Mozjs::YieldExpression),
(">>>=", Mozjs::GTGTGTEQ),
("while_statement", Mozjs::WhileStatement),
("set", Mozjs::Set),
("<=", Mozjs::LTEQ),
("switch_default", Mozjs::SwitchDefault),
("statement_identifier", Mozjs::StatementIdentifier),
("export_statement", Mozjs::ExportStatement),
("_template_chars", Mozjs::TemplateChars),
("pattern", Mozjs::Pattern),
("try", Mozjs::Try),
("export_clause", Mozjs::ExportClause),
("arrow_function", Mozjs::ArrowFunction),
("get", Mozjs::Get),
("class_body", Mozjs::ClassBody),
("??", Mozjs::QMARKQMARK),
("jsx_element", Mozjs::JsxElement),
("debugger_statement", Mozjs::DebuggerStatement),
("else_clause", Mozjs::ElseClause),
("case", Mozjs::Case),
("**=", Mozjs::STARSTAREQ),
("subscript_expression", Mozjs::SubscriptExpression),
("object_assignment_pattern", Mozjs::ObjectAssignmentPattern),
("import_statement", Mozjs::ImportStatement),
("\\\"", Mozjs::DQUOTE),
("super", Mozjs::Super),
("new_expression", Mozjs::NewExpression),
("hash_bang_line", Mozjs::HashBangLine),
("_automatic_semicolon", Mozjs::AutomaticSemicolon),
("try_statement", Mozjs::TryStatement),
("namespace_import", Mozjs::NamespaceImport),
("object_repeat1", Mozjs::ObjectRepeat1),
("assignment_expression", Mozjs::AssignmentExpression),
("||=", Mozjs::PIPEPIPEEQ),
("template_string", Mozjs::TemplateString),
("statement_block", Mozjs::StatementBlock),
("do", Mozjs::Do),
("%", Mozjs::PERCENT),
("?", Mozjs::QMARK),
("if_statement", Mozjs::IfStatement),
("/", Mozjs::SLASH),
("delete", Mozjs::Delete),
("!", Mozjs::BANG),
("++", Mozjs::PLUSPLUS),
("formal_parameters_repeat1", Mozjs::FormalParametersRepeat1),
("arguments", Mozjs::Arguments),
("do_statement", Mozjs::DoStatement),
("class", Mozjs::Class),
("spread_element", Mozjs::SpreadElement),
("+=", Mozjs::PLUSEQ),
("target", Mozjs::Target),
("class_declaration", Mozjs::ClassDeclaration),
("program_repeat1", Mozjs::ProgramRepeat1),
("(", Mozjs::LPAREN),
("call_expression", Mozjs::CallExpression),
("end", Mozjs::End),
("rest_pattern", Mozjs::RestPattern),
("{", Mozjs::LBRACE),
("object_pattern_repeat1", Mozjs::ObjectPatternRepeat1),
(";", Mozjs::SEMI),
]),
};

Просмотреть файл

@ -8,7 +8,7 @@
],
"sources": [
"src/parser.c",
"src/binding.cc"
"bindings/node/binding.cc"
],
"cflags_c": [
"-std=c99",

Просмотреть файл

@ -0,0 +1,19 @@
try {
module.exports = require("../../build/Release/tree_sitter_mozjs_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_mozjs_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
}
throw error1
}
}
try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");
} catch (_) {}

Просмотреть файл

@ -12,7 +12,7 @@ module.exports = grammar(JS, {
/#.*\n/,
),
_statement: ($, original) => choice(
statement: ($, original) => choice(
original,
$.preproc,
),

Просмотреть файл

@ -1,13 +0,0 @@
try {
module.exports = require("./build/Release/tree_sitter_mozjs_binding");
} catch (error) {
try {
module.exports = require("./build/Debug/tree_sitter_mozjs_binding");
} catch (_) {
throw error
}
}
try {
module.exports.nodeTypeInfo = require("./src/node-types.json");
} catch (_) {}

Просмотреть файл

@ -1,8 +1,8 @@
{
"name": "tree-sitter-mozjs",
"version": "0.17.0",
"version": "0.19.0",
"description": "Mozjs grammar for node-tree-sitter",
"main": "index.js",
"main": "bindings/node",
"keywords": [
"parser",
"lexer"
@ -13,7 +13,7 @@
"nan": "^2.14.2"
},
"devDependencies": {
"tree-sitter-cli": "^0.17.3"
"tree-sitter-cli": "^0.19.3"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,6 +1,6 @@
[
{
"type": "_declaration",
"type": "declaration",
"named": true,
"subtypes": [
{
@ -26,31 +26,9 @@
]
},
{
"type": "_destructuring_pattern",
"type": "expression",
"named": true,
"subtypes": [
{
"type": "array_pattern",
"named": true
},
{
"type": "object_pattern",
"named": true
}
]
},
{
"type": "_expression",
"named": true,
"subtypes": [
{
"type": "array",
"named": true
},
{
"type": "arrow_function",
"named": true
},
{
"type": "assignment_expression",
"named": true
@ -67,6 +45,78 @@
"type": "binary_expression",
"named": true
},
{
"type": "jsx_element",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
},
{
"type": "new_expression",
"named": true
},
{
"type": "primary_expression",
"named": true
},
{
"type": "ternary_expression",
"named": true
},
{
"type": "unary_expression",
"named": true
},
{
"type": "update_expression",
"named": true
},
{
"type": "yield_expression",
"named": true
}
]
},
{
"type": "pattern",
"named": true,
"subtypes": [
{
"type": "array_pattern",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "object_pattern",
"named": true
},
{
"type": "rest_pattern",
"named": true
}
]
},
{
"type": "primary_expression",
"named": true,
"subtypes": [
{
"type": "array",
"named": true
},
{
"type": "arrow_function",
"named": true
},
{
"type": "call_expression",
"named": true
@ -95,18 +145,6 @@
"type": "import",
"named": true
},
{
"type": "jsx_element",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
},
{
"type": "member_expression",
"named": true
@ -115,10 +153,6 @@
"type": "meta_property",
"named": true
},
{
"type": "new_expression",
"named": true
},
{
"type": "null",
"named": true
@ -155,10 +189,6 @@
"type": "template_string",
"named": true
},
{
"type": "ternary_expression",
"named": true
},
{
"type": "this",
"named": true
@ -167,32 +197,16 @@
"type": "true",
"named": true
},
{
"type": "unary_expression",
"named": true
},
{
"type": "undefined",
"named": true
},
{
"type": "update_expression",
"named": true
},
{
"type": "yield_expression",
"named": true
}
]
},
{
"type": "_statement",
"type": "statement",
"named": true,
"subtypes": [
{
"type": "_declaration",
"named": true
},
{
"type": "break_statement",
"named": true
@ -205,6 +219,10 @@
"type": "debugger_statement",
"named": true
},
{
"type": "declaration",
"named": true
},
{
"type": "do_statement",
"named": true
@ -284,7 +302,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -303,7 +321,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -322,11 +340,11 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "assignment_pattern",
"named": true
},
{
"type": "spread_element",
"type": "pattern",
"named": true
}
]
@ -341,7 +359,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -381,7 +399,7 @@
"required": true,
"types": [
{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true
},
{
@ -392,6 +410,10 @@
"type": "member_expression",
"named": true
},
{
"type": "object_pattern",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
@ -407,7 +429,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -423,11 +445,7 @@
"required": true,
"types": [
{
"type": "_destructuring_pattern",
"named": true
},
{
"type": "shorthand_property_identifier",
"type": "pattern",
"named": true
}
]
@ -437,7 +455,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -475,7 +493,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -491,7 +509,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -506,7 +524,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -622,7 +640,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -668,7 +686,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -694,12 +712,16 @@
"required": false,
"types": [
{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "object_pattern",
"named": true
}
]
}
@ -826,7 +848,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -841,7 +863,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -900,7 +922,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -926,7 +948,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -987,7 +1009,7 @@
"required": false,
"types": [
{
"type": "_declaration",
"type": "declaration",
"named": true
}
]
@ -1017,7 +1039,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -1043,7 +1065,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -1078,7 +1100,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -1088,7 +1110,7 @@
"required": true,
"types": [
{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true
},
{
@ -1099,6 +1121,10 @@
"type": "member_expression",
"named": true
},
{
"type": "object_pattern",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
@ -1114,7 +1140,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -1134,7 +1160,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -1158,7 +1184,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -1199,20 +1225,12 @@
"multiple": true,
"required": false,
"types": [
{
"type": "_destructuring_pattern",
"named": true
},
{
"type": "assignment_pattern",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "rest_parameter",
"type": "pattern",
"named": true
}
]
@ -1391,7 +1409,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -1602,7 +1620,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -1758,7 +1776,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -1788,7 +1806,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -1936,95 +1954,7 @@
"required": true,
"types": [
{
"type": "array",
"named": true
},
{
"type": "arrow_function",
"named": true
},
{
"type": "call_expression",
"named": true
},
{
"type": "class",
"named": true
},
{
"type": "false",
"named": true
},
{
"type": "function",
"named": true
},
{
"type": "generator_function",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "import",
"named": true
},
{
"type": "member_expression",
"named": true
},
{
"type": "meta_property",
"named": true
},
{
"type": "null",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "object",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
},
{
"type": "regex",
"named": true
},
{
"type": "string",
"named": true
},
{
"type": "subscript_expression",
"named": true
},
{
"type": "super",
"named": true
},
{
"type": "template_string",
"named": true
},
{
"type": "this",
"named": true
},
{
"type": "true",
"named": true
},
{
"type": "undefined",
"type": "primary_expression",
"named": true
}
]
@ -2039,10 +1969,6 @@
"multiple": true,
"required": false,
"types": [
{
"type": "assignment_pattern",
"named": true
},
{
"type": "method_definition",
"named": true
@ -2062,6 +1988,40 @@
]
}
},
{
"type": "object_assignment_pattern",
"named": true,
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "array_pattern",
"named": true
},
{
"type": "object_pattern",
"named": true
},
{
"type": "shorthand_property_identifier_pattern",
"named": true
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression",
"named": true
}
]
}
}
},
{
"type": "object_pattern",
"named": true,
@ -2071,23 +2031,19 @@
"required": false,
"types": [
{
"type": "assignment_pattern",
"type": "object_assignment_pattern",
"named": true
},
{
"type": "method_definition",
"type": "pair_pattern",
"named": true
},
{
"type": "pair",
"type": "rest_pattern",
"named": true
},
{
"type": "shorthand_property_identifier",
"named": true
},
{
"type": "spread_element",
"type": "shorthand_property_identifier_pattern",
"named": true
}
]
@ -2124,7 +2080,45 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
}
}
},
{
"type": "pair_pattern",
"named": true,
"fields": {
"key": {
"multiple": false,
"required": true,
"types": [
{
"type": "computed_property_name",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "property_identifier",
"named": true
},
{
"type": "string",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "pattern",
"named": true
}
]
@ -2140,7 +2134,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2159,11 +2153,11 @@
"required": false,
"types": [
{
"type": "_statement",
"type": "hash_bang_line",
"named": true
},
{
"type": "hash_bang_line",
"type": "statement",
"named": true
}
]
@ -2200,7 +2194,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2234,7 +2228,7 @@
}
},
{
"type": "rest_parameter",
"type": "rest_pattern",
"named": true,
"fields": {},
"children": {
@ -2242,12 +2236,16 @@
"required": true,
"types": [
{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "object_pattern",
"named": true
}
]
}
@ -2261,7 +2259,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2280,7 +2278,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2290,7 +2288,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2310,7 +2308,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2325,7 +2323,7 @@
"required": false,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -2355,7 +2353,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2369,7 +2367,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2404,7 +2402,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2419,7 +2417,7 @@
"required": false,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -2434,7 +2432,7 @@
"required": false,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -2494,7 +2492,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2513,7 +2511,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2523,7 +2521,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2533,7 +2531,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2549,7 +2547,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
},
{
@ -2604,7 +2602,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2654,7 +2652,7 @@
"required": true,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2699,12 +2697,16 @@
"required": true,
"types": [
{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "object_pattern",
"named": true
}
]
},
@ -2713,7 +2715,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -2729,7 +2731,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -2755,7 +2757,7 @@
"required": true,
"types": [
{
"type": "_statement",
"type": "statement",
"named": true
}
]
@ -2781,7 +2783,7 @@
"required": false,
"types": [
{
"type": "_expression",
"type": "expression",
"named": true
}
]
@ -3179,6 +3181,10 @@
"type": "shorthand_property_identifier",
"named": true
},
{
"type": "shorthand_property_identifier_pattern",
"named": true
},
{
"type": "statement_identifier",
"named": true

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -13,6 +13,8 @@ extern "C" {
#define ts_builtin_sym_end 0
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
typedef uint16_t TSStateId;
#ifndef TREE_SITTER_API_H_
typedef uint16_t TSSymbol;
typedef uint16_t TSFieldId;
@ -30,12 +32,10 @@ typedef struct {
uint16_t length;
} TSFieldMapSlice;
typedef uint16_t TSStateId;
typedef struct {
bool visible : 1;
bool named : 1;
bool supertype: 1;
bool visible;
bool named;
bool supertype;
} TSSymbolMetadata;
typedef struct TSLexer TSLexer;
@ -57,21 +57,21 @@ typedef enum {
TSParseActionTypeRecover,
} TSParseActionType;
typedef struct {
union {
struct {
TSStateId state;
bool extra : 1;
bool repetition : 1;
} shift;
struct {
TSSymbol symbol;
int16_t dynamic_precedence;
uint8_t child_count;
uint8_t production_id;
} reduce;
} params;
TSParseActionType type : 4;
typedef union {
struct {
uint8_t type;
TSStateId state;
bool extra;
bool repetition;
} shift;
struct {
uint8_t type;
uint8_t child_count;
TSSymbol symbol;
int16_t dynamic_precedence;
uint16_t production_id;
} reduce;
uint8_t type;
} TSParseAction;
typedef struct {
@ -83,7 +83,7 @@ typedef union {
TSParseAction action;
struct {
uint8_t count;
bool reusable : 1;
bool reusable;
} entry;
} TSParseActionEntry;
@ -93,13 +93,24 @@ struct TSLanguage {
uint32_t alias_count;
uint32_t token_count;
uint32_t external_token_count;
const char **symbol_names;
const TSSymbolMetadata *symbol_metadata;
const uint16_t *parse_table;
const TSParseActionEntry *parse_actions;
const TSLexMode *lex_modes;
const TSSymbol *alias_sequences;
uint32_t state_count;
uint32_t large_state_count;
uint32_t production_id_count;
uint32_t field_count;
uint16_t max_alias_sequence_length;
const uint16_t *parse_table;
const uint16_t *small_parse_table;
const uint32_t *small_parse_table_map;
const TSParseActionEntry *parse_actions;
const char **symbol_names;
const char **field_names;
const TSFieldMapSlice *field_map_slices;
const TSFieldMapEntry *field_map_entries;
const TSSymbolMetadata *symbol_metadata;
const TSSymbol *public_symbol_map;
const uint16_t *alias_map;
const TSSymbol *alias_sequences;
const TSLexMode *lex_modes;
bool (*lex_fn)(TSLexer *, TSStateId);
bool (*keyword_lex_fn)(TSLexer *, TSStateId);
TSSymbol keyword_capture_token;
@ -112,16 +123,6 @@ struct TSLanguage {
unsigned (*serialize)(void *, char *);
void (*deserialize)(void *, const char *, unsigned);
} external_scanner;
uint32_t field_count;
const TSFieldMapSlice *field_map_slices;
const TSFieldMapEntry *field_map_entries;
const char **field_names;
uint32_t large_state_count;
const uint16_t *small_parse_table;
const uint32_t *small_parse_table_map;
const TSSymbol *public_symbol_map;
const uint16_t *alias_map;
uint32_t state_count;
};
/*
@ -170,66 +171,50 @@ struct TSLanguage {
#define ACTIONS(id) id
#define SHIFT(state_value) \
{ \
{ \
.params = { \
.shift = { \
.state = state_value \
} \
}, \
.type = TSParseActionTypeShift \
} \
}
#define SHIFT(state_value) \
{{ \
.shift = { \
.type = TSParseActionTypeShift, \
.state = state_value \
} \
}}
#define SHIFT_REPEAT(state_value) \
{ \
{ \
.params = { \
.shift = { \
.state = state_value, \
.repetition = true \
} \
}, \
.type = TSParseActionTypeShift \
{{ \
.shift = { \
.type = TSParseActionTypeShift, \
.state = state_value, \
.repetition = true \
} \
}
#define RECOVER() \
{ \
{ .type = TSParseActionTypeRecover } \
}
}}
#define SHIFT_EXTRA() \
{ \
{ \
.params = { \
.shift = { \
.extra = true \
} \
}, \
.type = TSParseActionTypeShift \
{{ \
.shift = { \
.type = TSParseActionTypeShift, \
.extra = true \
} \
}
}}
#define REDUCE(symbol_val, child_count_val, ...) \
{ \
{ \
.params = { \
.reduce = { \
.symbol = symbol_val, \
.child_count = child_count_val, \
__VA_ARGS__ \
}, \
}, \
.type = TSParseActionTypeReduce \
} \
}
{{ \
.reduce = { \
.type = TSParseActionTypeReduce, \
.symbol = symbol_val, \
.child_count = child_count_val, \
__VA_ARGS__ \
}, \
}}
#define ACCEPT_INPUT() \
{ \
{ .type = TSParseActionTypeAccept } \
}
#define RECOVER() \
{{ \
.type = TSParseActionTypeRecover \
}}
#define ACCEPT_INPUT() \
{{ \
.type = TSParseActionTypeAccept \
}}
#ifdef __cplusplus
}