@willbooster/tree-sitter-ruby 3.0.0 → 3.0.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
@@ -1556,7 +1556,14 @@ module.exports = grammar({
1556
1556
  instance_variable: () => token(seq('@', ALPHA_CHAR, IDENTIFIER_CHARS)),
1557
1557
  class_variable: () => token(seq('@@', ALPHA_CHAR, IDENTIFIER_CHARS)),
1558
1558
 
1559
- global_variable: () => /\$(-[a-zA-Z0-9_]|[!@&`'+~=/\\,;.<>*$?:"]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)/,
1559
+ global_variable: () =>
1560
+ token(
1561
+ choice(
1562
+ /\$(-[a-zA-Z0-9_]|[!@&`'+~=/\\,;.<>*$?:"]|[0-9]+)/,
1563
+ seq('$-', /[^\u0000-\u007F]/),
1564
+ seq('$', ALPHA_CHAR, IDENTIFIER_CHARS)
1565
+ )
1566
+ ),
1560
1567
 
1561
1568
  chained_string: ($) => seq($.string, repeat1($.string)),
1562
1569
 
@@ -1652,11 +1659,19 @@ module.exports = grammar({
1652
1659
  '->',
1653
1660
  field(
1654
1661
  'parameters',
1655
- optional(choice(alias($.parameters, $.lambda_parameters), alias($.bare_parameters, $.lambda_parameters)))
1662
+ optional(
1663
+ choice(
1664
+ alias($._parenthesized_lambda_parameters, $.lambda_parameters),
1665
+ alias($.bare_parameters, $.lambda_parameters)
1666
+ )
1667
+ )
1656
1668
  ),
1657
1669
  field('body', choice($.block, $.do_block))
1658
1670
  ),
1659
1671
 
1672
+ _parenthesized_lambda_parameters: ($) =>
1673
+ seq('(', commaSep($._formal_parameter), optional(seq(';', sep1(field('locals', $.identifier), ','))), ')'),
1674
+
1660
1675
  empty_statement: () => prec(-1, ';'),
1661
1676
 
1662
1677
  _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": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Ruby grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -2346,7 +2346,18 @@
2346
2346
  {
2347
2347
  "type": "lambda_parameters",
2348
2348
  "named": true,
2349
- "fields": {},
2349
+ "fields": {
2350
+ "locals": {
2351
+ "multiple": true,
2352
+ "required": false,
2353
+ "types": [
2354
+ {
2355
+ "type": "identifier",
2356
+ "named": true
2357
+ }
2358
+ ]
2359
+ }
2360
+ },
2350
2361
  "children": {
2351
2362
  "multiple": true,
2352
2363
  "required": false,
Binary file
package/tree-sitter.json CHANGED
@@ -19,7 +19,7 @@
19
19
  }
20
20
  ],
21
21
  "metadata": {
22
- "version": "3.0.0",
22
+ "version": "3.0.2",
23
23
  "license": "MIT",
24
24
  "description": "Ruby grammar for tree-sitter",
25
25
  "authors": [