@willbooster/tree-sitter-ruby 3.0.5 → 3.0.6

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
@@ -1207,10 +1207,20 @@ module.exports = grammar({
1207
1207
  PREC.CURLY_BLOCK,
1208
1208
  prec.dynamic(
1209
1209
  2,
1210
- seq('{', field('parameters', optional($.block_parameters)), optional(field('body', $.block_body)), '}')
1210
+ seq(
1211
+ $._block_open,
1212
+ field('parameters', optional($.block_parameters)),
1213
+ optional(field('body', $.block_body)),
1214
+ '}'
1215
+ )
1211
1216
  )
1212
1217
  ),
1213
1218
 
1219
+ // Where both a block and a hash argument can start (`foo {`, `x.y {`), the `{` would otherwise be shared until a
1220
+ // later conflict picks the hash. Reducing the brace on its own forces the choice right after it, and the precedence
1221
+ // makes it a block, as in Ruby.
1222
+ _block_open: () => prec(PREC.CURLY_BLOCK, '{'),
1223
+
1214
1224
  _arg_rhs: ($) => choice($._arg, alias($.rescue_modifier_arg, $.rescue_modifier)),
1215
1225
 
1216
1226
  _ordinary_rhs_expression: ($) => prec(PREC.ASSIGN, $._arg_rhs),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-ruby",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Ruby grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -19,7 +19,7 @@
19
19
  }
20
20
  ],
21
21
  "metadata": {
22
- "version": "3.0.5",
22
+ "version": "3.0.6",
23
23
  "license": "MIT",
24
24
  "description": "Ruby grammar for tree-sitter",
25
25
  "authors": [