@willbooster/tree-sitter-ruby 12.0.0 → 13.0.0

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
@@ -276,7 +276,8 @@ module.exports = grammar({
276
276
  ),
277
277
  choice(
278
278
  seq(field('parameters', alias($.parameters, $.method_parameters)), optional($._terminator)),
279
- seq(optional(field('parameters', alias($.bare_parameters, $.method_parameters))), $._body_separator)
279
+ seq(field('parameters', alias($.bare_parameters, $.method_parameters)), $._terminator),
280
+ $._body_separator
280
281
  )
281
282
  )
282
283
  ),
@@ -400,7 +401,7 @@ module.exports = grammar({
400
401
  seq(
401
402
  'class',
402
403
  field('name', choice($.constant, $.scope_resolution)),
403
- choice(seq(field('superclass', $.superclass), $._body_separator), optional($._terminator)),
404
+ choice(seq(field('superclass', $.superclass), $._terminator), optional($._terminator)),
404
405
  optional(field('body', $.body_statement)),
405
406
  'end'
406
407
  ),
@@ -412,7 +413,7 @@ module.exports = grammar({
412
413
  'class',
413
414
  alias($._singleton_class_left_angle_left_langle, '<<'),
414
415
  field('value', $._arg),
415
- $._body_separator,
416
+ $._terminator,
416
417
  optional(field('body', $.body_statement)),
417
418
  'end'
418
419
  ),
@@ -1761,6 +1762,9 @@ module.exports = grammar({
1761
1762
 
1762
1763
  empty_statement: () => prec(-1, ';'),
1763
1764
 
1765
+ // The scanner emits comments after this line break into the body even when only comments precede `end`. It follows
1766
+ // only a method name: after an expression, its validity would split the states of every expression from those of
1767
+ // other contexts.
1764
1768
  _body_separator: ($) => choice(prec.dynamic(1, $._body_line_break), ';'),
1765
1769
 
1766
1770
  _terminator: ($) => choice(prec.dynamic(1, $._line_break), ';'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-ruby",
3
- "version": "12.0.0",
3
+ "version": "13.0.0",
4
4
  "description": "Ruby grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "12.0.0",
16
+ "version": "13.0.0",
17
17
  "license": "MIT",
18
18
  "description": "Ruby grammar for tree-sitter",
19
19
  "authors": [