@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 +17 -2
- package/package.json +1 -1
- package/src/node-types.json +12 -1
- package/tree-sitter-ruby.wasm +0 -0
- package/tree-sitter.json +1 -1
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: () =>
|
|
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(
|
|
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
package/src/node-types.json
CHANGED
|
@@ -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,
|
package/tree-sitter-ruby.wasm
CHANGED
|
Binary file
|