diff --git a/grammar.js b/grammar.js index f4194ec..98e64e5 100644 --- a/grammar.js +++ b/grammar.js @@ -58,6 +58,7 @@ module.exports = grammar({ precedences: $ => [ [ 'member', + 'template_call', 'call', $.update_expression, 'unary_void', @@ -78,7 +79,7 @@ module.exports = grammar({ $.arrow_function, ], ['assign', $.primary_expression], - ['member', 'template_call', 'new', 'call', $.expression], + ['member', 'template_call', 'new', 'call', $.expression], ['declaration', 'literal'], [$.primary_expression, $.statement_block, 'object'], [$.meta_property, $.import], diff --git a/src/grammar.json b/src/grammar.json index ab6f412..cabfbc3 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -6778,6 +6778,10 @@ "type": "STRING", "value": "member" }, + { + "type": "STRING", + "value": "template_call" + }, { "type": "STRING", "value": "call" diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 089f2f8..6d8f174 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -155,6 +155,7 @@ Complex function calls with template strings new f()`hello`; new f`hello`; arr[0]`hello`; +f`hello``goodbye`; --- (program @@ -176,6 +177,14 @@ arr[0]`hello`; (subscript_expression (identifier) (number)) + (template_string + (string_fragment)))) + (expression_statement + (call_expression + (call_expression + (identifier) + (template_string + (string_fragment))) (template_string (string_fragment)))))