111 changes: 38 additions & 73 deletions src/node-types.json
Expand Up @@ -53,10 +53,6 @@
"type": "jsx_element",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
Expand Down Expand Up @@ -1784,10 +1780,6 @@
"type": "jsx_expression",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_namespace_name",
"named": true
Expand All @@ -1813,7 +1805,7 @@
"fields": {
"name": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "identifier",
Expand All @@ -1824,7 +1816,7 @@
"named": true
},
{
"type": "nested_identifier",
"type": "member_expression",
"named": true
}
]
Expand Down Expand Up @@ -1868,10 +1860,6 @@
"type": "jsx_expression",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
Expand Down Expand Up @@ -1906,37 +1894,6 @@
]
}
},
{
"type": "jsx_fragment",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "jsx_element",
"named": true
},
{
"type": "jsx_expression",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
},
{
"type": "jsx_text",
"named": true
}
]
}
},
{
"type": "jsx_namespace_name",
"named": true,
Expand Down Expand Up @@ -1972,7 +1929,7 @@
},
"name": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "identifier",
Expand All @@ -1983,7 +1940,7 @@
"named": true
},
{
"type": "nested_identifier",
"type": "member_expression",
"named": true
}
]
Expand Down Expand Up @@ -2021,13 +1978,18 @@
"named": true
},
{
"type": "nested_identifier",
"type": "member_expression",
"named": true
}
]
}
}
},
{
"type": "jsx_text",
"named": true,
"fields": {}
},
{
"type": "labeled_statement",
"named": true,
Expand Down Expand Up @@ -2090,7 +2052,7 @@
"fields": {
"object": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "expression",
Expand All @@ -2110,7 +2072,7 @@
},
"property": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "private_property_identifier",
Expand All @@ -2122,6 +2084,24 @@
}
]
}
},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "identifier",
"named": true
},
{
"type": "member_expression",
"named": true
},
{
"type": "property_identifier",
"named": true
}
]
}
},
{
Expand Down Expand Up @@ -2240,25 +2220,6 @@
]
}
},
{
"type": "nested_identifier",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
},
{
"type": "nested_identifier",
"named": true
}
]
}
},
{
"type": "new_expression",
"named": true,
Expand Down Expand Up @@ -3234,6 +3195,10 @@
"type": "/=",
"named": false
},
{
"type": "/>",
"named": false
},
{
"type": ":",
"named": false
Expand All @@ -3246,6 +3211,10 @@
"type": "<",
"named": false
},
{
"type": "</",
"named": false
},
{
"type": "</template>",
"named": false
Expand Down Expand Up @@ -3462,10 +3431,6 @@
"type": "instanceof",
"named": false
},
{
"type": "jsx_text",
"named": true
},
{
"type": "let",
"named": false
Expand Down
81,650 changes: 40,412 additions & 41,238 deletions src/parser.c

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions test/corpus/expressions.txt
Expand Up @@ -1280,15 +1280,15 @@ b = <Foo.Bar.Baz.Baz></Foo.Bar.Baz.Baz>;
(expression_statement (assignment_expression
(identifier)
(jsx_element
(jsx_opening_element (nested_identifier (identifier) (identifier)))
(jsx_opening_element (member_expression (identifier) (property_identifier)))
(jsx_text)
(jsx_element
(jsx_opening_element (identifier))
(jsx_text)
(jsx_closing_element (identifier)))
(jsx_text)
(jsx_closing_element (nested_identifier (identifier) (identifier))))))
(expression_statement (assignment_expression (identifier) (jsx_element (jsx_opening_element (nested_identifier (nested_identifier (nested_identifier (identifier) (identifier)) (identifier)) (identifier))) (jsx_closing_element (nested_identifier (nested_identifier (nested_identifier (identifier) (identifier)) (identifier)) (identifier)))))))
(jsx_closing_element (member_expression (identifier) (property_identifier))))))
(expression_statement (assignment_expression (identifier) (jsx_element (jsx_opening_element (member_expression (member_expression (member_expression (identifier) (property_identifier)) (property_identifier)) (property_identifier))) (jsx_closing_element (member_expression (member_expression (member_expression (identifier) (property_identifier)) (property_identifier)) (property_identifier)))))))

==============================================
Anonymous JSX element
Expand All @@ -1303,13 +1303,17 @@ a = <E><></></E>;
(expression_statement
(assignment_expression
(identifier)
(jsx_fragment)))
(jsx_element
(jsx_opening_element)
(jsx_closing_element))))
(expression_statement
(assignment_expression
(identifier)
(jsx_element
(jsx_opening_element (identifier))
(jsx_fragment)
(jsx_element
(jsx_opening_element)
(jsx_closing_element))
(jsx_closing_element (identifier))))))

==============================================
Expand Down Expand Up @@ -1448,16 +1452,14 @@ i = <Foo:Bar bar={}>{...children}</Foo:Bar>
(jsx_element (jsx_opening_element (identifier)) (jsx_closing_element (identifier)))))
(expression_statement (assignment_expression (identifier)
(jsx_element
(jsx_opening_element (nested_identifier (identifier) (identifier)))
(jsx_closing_element (nested_identifier (identifier) (identifier))))))
(jsx_opening_element (member_expression (identifier) (property_identifier)))
(jsx_closing_element (member_expression (identifier) (property_identifier))))))
(expression_statement (assignment_expression (identifier)
(jsx_fragment (jsx_text) (jsx_self_closing_element (identifier)) (jsx_text))))
(jsx_element (jsx_opening_element) (jsx_self_closing_element (identifier)) (jsx_closing_element))))
(expression_statement (assignment_expression (identifier)
(jsx_element
(jsx_opening_element (identifier))
(jsx_text)
(jsx_self_closing_element (identifier))
(jsx_text)
(jsx_closing_element (identifier)))))
(expression_statement (assignment_expression (identifier)
(jsx_self_closing_element (identifier) (jsx_attribute (property_identifier)))))
Expand Down Expand Up @@ -1491,7 +1493,6 @@ i = <Foo:Bar bar={}>{...children}</Foo:Bar>
(member_expression
(member_expression (this) (property_identifier))
(property_identifier)))))))
(jsx_text)
(jsx_closing_element (identifier)))))
(expression_statement (assignment_expression (identifier)
(jsx_element
Expand Down
Binary file modified tree-sitter-javascript.wasm
Binary file not shown.