Skip to content

Commit 1d05f78

Browse files
committed
Reduce new_expression precedence to match call_expression
1 parent 15d5e85 commit 1d05f78

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PREC = {
2020
NEG: 10,
2121
INC: 11,
2222
CALL: 12,
23-
NEW: 13,
23+
NEW: 12,
2424
MEMBER: 14
2525
};
2626

@@ -630,7 +630,7 @@ module.exports = grammar({
630630
field('arguments', choice($.arguments, $.template_string))
631631
)),
632632

633-
new_expression: $ => prec.right(PREC.NEW, seq(
633+
new_expression: $ => prec(PREC.NEW, seq(
634634
'new',
635635
field('constructor', $._expression),
636636
field('arguments', optional($.arguments))

src/grammar.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,8 +2725,8 @@
27252725
}
27262726
},
27272727
"new_expression": {
2728-
"type": "PREC_RIGHT",
2729-
"value": 13,
2728+
"type": "PREC",
2729+
"value": 12,
27302730
"content": {
27312731
"type": "SEQ",
27322732
"members": [

0 commit comments

Comments
 (0)