Skip to content

Commit 4308c48

Browse files
committed
add new call type to existing precedences, add to tests, fix some ws
1 parent e8aa753 commit 4308c48

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

grammar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module.exports = grammar({
5858
precedences: $ => [
5959
[
6060
'member',
61+
'template_call',
6162
'call',
6263
$.update_expression,
6364
'unary_void',
@@ -78,7 +79,7 @@ module.exports = grammar({
7879
$.arrow_function,
7980
],
8081
['assign', $.primary_expression],
81-
['member', 'template_call', 'new', 'call', $.expression],
82+
['member', 'template_call', 'new', 'call', $.expression],
8283
['declaration', 'literal'],
8384
[$.primary_expression, $.statement_block, 'object'],
8485
[$.meta_property, $.import],

src/grammar.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/expressions.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Complex function calls with template strings
155155
new f()`hello`;
156156
new f`hello`;
157157
arr[0]`hello`;
158+
f`hello``goodbye`;
158159

159160
---
160161
(program
@@ -176,6 +177,14 @@ arr[0]`hello`;
176177
(subscript_expression
177178
(identifier)
178179
(number))
180+
(template_string
181+
(string_fragment))))
182+
(expression_statement
183+
(call_expression
184+
(call_expression
185+
(identifier)
186+
(template_string
187+
(string_fragment)))
179188
(template_string
180189
(string_fragment)))))
181190

0 commit comments

Comments
 (0)