Skip to content

Commit f64397a

Browse files
Rename to constructable expression
Co-Authored-By: Max Brunsfeld <[email protected]>
1 parent 9b0783a commit f64397a

File tree

3 files changed

+46478
-46977
lines changed

3 files changed

+46478
-46977
lines changed

grammar.js

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = grammar({
3737
],
3838

3939
inline: $ => [
40-
$._new_member_expression,
40+
$._constructable_expression,
4141
$._statement,
4242
$._expressions,
4343
$._semicolon,
@@ -388,15 +388,9 @@ module.exports = grammar({
388388
),
389389

390390
_expression: $ => choice(
391-
$.object,
392-
$.array,
391+
$._constructable_expression,
393392
$._jsx_element,
394393
$.jsx_fragment,
395-
$.class,
396-
$.anonymous_class,
397-
$.function,
398-
$.arrow_function,
399-
$.generator_function,
400394

401395
$.assignment_expression,
402396
$.augmented_assignment_expression,
@@ -406,23 +400,7 @@ module.exports = grammar({
406400
$.ternary_expression,
407401
$.update_expression,
408402
$.call_expression,
409-
$.member_expression,
410-
$.new_expression,
411-
$.parenthesized_expression,
412-
$.subscript_expression,
413403
$.yield_expression,
414-
$.this,
415-
416-
$.number,
417-
$.string,
418-
$.template_string,
419-
$.regex,
420-
$.true,
421-
$.false,
422-
$.null,
423-
$.undefined,
424-
$.identifier,
425-
alias($._reserved_identifier, $.identifier)
426404
),
427405

428406
yield_expression: $ => prec.right(seq(
@@ -591,12 +569,12 @@ module.exports = grammar({
591569
new_expression: $ => prec.right(PREC.NEW, seq(
592570
'new',
593571

594-
$._new_member_expression,
572+
$._constructable_expression,
595573

596574
optional($.arguments)
597575
)),
598576

599-
_new_member_expression: $ => choice(
577+
_constructable_expression: $ => choice(
600578
// Primary Expression
601579
$.this,
602580
$.identifier,

src/grammar.json

Lines changed: 4 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,11 +1386,7 @@
13861386
"members": [
13871387
{
13881388
"type": "SYMBOL",
1389-
"name": "object"
1390-
},
1391-
{
1392-
"type": "SYMBOL",
1393-
"name": "array"
1389+
"name": "_constructable_expression"
13941390
},
13951391
{
13961392
"type": "SYMBOL",
@@ -1400,26 +1396,6 @@
14001396
"type": "SYMBOL",
14011397
"name": "jsx_fragment"
14021398
},
1403-
{
1404-
"type": "SYMBOL",
1405-
"name": "class"
1406-
},
1407-
{
1408-
"type": "SYMBOL",
1409-
"name": "anonymous_class"
1410-
},
1411-
{
1412-
"type": "SYMBOL",
1413-
"name": "function"
1414-
},
1415-
{
1416-
"type": "SYMBOL",
1417-
"name": "arrow_function"
1418-
},
1419-
{
1420-
"type": "SYMBOL",
1421-
"name": "generator_function"
1422-
},
14231399
{
14241400
"type": "SYMBOL",
14251401
"name": "assignment_expression"
@@ -1452,74 +1428,9 @@
14521428
"type": "SYMBOL",
14531429
"name": "call_expression"
14541430
},
1455-
{
1456-
"type": "SYMBOL",
1457-
"name": "member_expression"
1458-
},
1459-
{
1460-
"type": "SYMBOL",
1461-
"name": "new_expression"
1462-
},
1463-
{
1464-
"type": "SYMBOL",
1465-
"name": "parenthesized_expression"
1466-
},
1467-
{
1468-
"type": "SYMBOL",
1469-
"name": "subscript_expression"
1470-
},
14711431
{
14721432
"type": "SYMBOL",
14731433
"name": "yield_expression"
1474-
},
1475-
{
1476-
"type": "SYMBOL",
1477-
"name": "this"
1478-
},
1479-
{
1480-
"type": "SYMBOL",
1481-
"name": "number"
1482-
},
1483-
{
1484-
"type": "SYMBOL",
1485-
"name": "string"
1486-
},
1487-
{
1488-
"type": "SYMBOL",
1489-
"name": "template_string"
1490-
},
1491-
{
1492-
"type": "SYMBOL",
1493-
"name": "regex"
1494-
},
1495-
{
1496-
"type": "SYMBOL",
1497-
"name": "true"
1498-
},
1499-
{
1500-
"type": "SYMBOL",
1501-
"name": "false"
1502-
},
1503-
{
1504-
"type": "SYMBOL",
1505-
"name": "null"
1506-
},
1507-
{
1508-
"type": "SYMBOL",
1509-
"name": "undefined"
1510-
},
1511-
{
1512-
"type": "SYMBOL",
1513-
"name": "identifier"
1514-
},
1515-
{
1516-
"type": "ALIAS",
1517-
"content": {
1518-
"type": "SYMBOL",
1519-
"name": "_reserved_identifier"
1520-
},
1521-
"named": true,
1522-
"value": "identifier"
15231434
}
15241435
]
15251436
},
@@ -2445,7 +2356,7 @@
24452356
},
24462357
{
24472358
"type": "SYMBOL",
2448-
"name": "_new_member_expression"
2359+
"name": "_constructable_expression"
24492360
},
24502361
{
24512362
"type": "CHOICE",
@@ -2462,7 +2373,7 @@
24622373
]
24632374
}
24642375
},
2465-
"_new_member_expression": {
2376+
"_constructable_expression": {
24662377
"type": "CHOICE",
24672378
"members": [
24682379
{
@@ -4978,7 +4889,7 @@
49784889
}
49794890
],
49804891
"inline": [
4981-
"_new_member_expression",
4892+
"_constructable_expression",
49824893
"_statement",
49834894
"_expressions",
49844895
"_semicolon",

0 commit comments

Comments
 (0)