@willbooster/tree-sitter-javascript 7.1.0 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grammar.js CHANGED
@@ -124,6 +124,7 @@ module.exports = grammar({
124
124
  sym('_yield_identifier'),
125
125
  sym('_function_signature_start'),
126
126
  sym('_async_function_signature_start'),
127
+ sym('_call_arguments_context'),
127
128
  ],
128
129
 
129
130
  extras: ($) => [$.comment, sym('html_comment'), /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
@@ -1393,7 +1394,8 @@ module.exports = grammar({
1393
1394
  // Expression components
1394
1395
  //
1395
1396
 
1396
- arguments: ($) => seq('(', commaSep(optional(choice($.expression, $.spread_element))), ')'),
1397
+ arguments: ($) =>
1398
+ seq(choice('(', sym('_call_arguments_context')), commaSep(optional(choice($.expression, $.spread_element))), ')'),
1397
1399
 
1398
1400
  decorator: ($) =>
1399
1401
  seq(
@@ -1506,11 +1508,23 @@ module.exports = grammar({
1506
1508
  ...(async ? ['async'] : []),
1507
1509
  ...(generator ? ['*'] : [optional(choice('get', 'set'))]),
1508
1510
  field('name', $._property_name),
1509
- field('parameters', $.formal_parameters),
1510
- functionScope(
1511
- async,
1512
- field('body', alias($._class_member_body, $.statement_block)),
1513
- generator ? 'generator_function' : 'function'
1511
+ choice(
1512
+ functionScope(
1513
+ async,
1514
+ seq(
1515
+ field('parameters', $.formal_parameters),
1516
+ field('body', alias($._class_member_body, $.statement_block))
1517
+ ),
1518
+ generator ? 'generator_function' : 'function_signature'
1519
+ ),
1520
+ ...(generator
1521
+ ? []
1522
+ : [
1523
+ seq(
1524
+ field('parameters', $.formal_parameters),
1525
+ functionScope(async, field('body', alias($._class_member_body, $.statement_block)), 'function')
1526
+ ),
1527
+ ])
1514
1528
  )
1515
1529
  )
1516
1530
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-javascript",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "JavaScript grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -48,7 +48,7 @@
48
48
  }
49
49
  ],
50
50
  "metadata": {
51
- "version": "7.1.0",
51
+ "version": "7.1.2",
52
52
  "license": "MIT",
53
53
  "description": "JavaScript grammar for tree-sitter",
54
54
  "authors": [