@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 +7 -3
- package/package.json +1 -1
- package/tree-sitter-ruby.wasm +0 -0
- package/tree-sitter.json +1 -1
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(
|
|
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), $.
|
|
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
|
-
$.
|
|
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
package/tree-sitter-ruby.wasm
CHANGED
|
Binary file
|