@willbooster/tree-sitter-ruby 3.0.4 → 3.0.5
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 +13 -1
- package/package.json +1 -1
- package/tree-sitter-ruby.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -86,6 +86,7 @@ module.exports = grammar({
|
|
|
86
86
|
$._block_comment,
|
|
87
87
|
$._uninterpreted,
|
|
88
88
|
$._not_parenthesized,
|
|
89
|
+
$._lambda_brace,
|
|
89
90
|
],
|
|
90
91
|
|
|
91
92
|
extras: ($) => [$.comment, $.heredoc_body, /\s/, /\\\r?\n/],
|
|
@@ -1666,7 +1667,18 @@ module.exports = grammar({
|
|
|
1666
1667
|
)
|
|
1667
1668
|
)
|
|
1668
1669
|
),
|
|
1669
|
-
field('body', choice($.block, $.do_block))
|
|
1670
|
+
field('body', choice(alias($._lambda_block, $.block), $.do_block))
|
|
1671
|
+
),
|
|
1672
|
+
|
|
1673
|
+
// As with parse.y's tLAMBEG, the scanner emits this `{` where a lambda body can start, so that it opens the body
|
|
1674
|
+
// after bare parameters even where a parameter default could take a block or start a hash (`-> a=b() { }`,
|
|
1675
|
+
// `-> x: { }`).
|
|
1676
|
+
_lambda_block: ($) =>
|
|
1677
|
+
seq(
|
|
1678
|
+
alias($._lambda_brace, '{'),
|
|
1679
|
+
field('parameters', optional($.block_parameters)),
|
|
1680
|
+
optional(field('body', $.block_body)),
|
|
1681
|
+
'}'
|
|
1670
1682
|
),
|
|
1671
1683
|
|
|
1672
1684
|
_parenthesized_lambda_parameters: ($) =>
|
package/package.json
CHANGED
package/tree-sitter-ruby.wasm
CHANGED
|
Binary file
|