@willbooster/tree-sitter-ruby 2.0.13 → 3.0.1
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/README.md +6 -6
- package/grammar.js +9 -1
- package/package.json +3 -3
- package/src/node-types.json +12 -1
- package/tree-sitter-ruby.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ to its authors and contributors. This is not an official release of that project
|
|
|
14
14
|
|
|
15
15
|
This fork extends the upstream grammar to parse anonymous block forwarding, spaced block arguments, and command calls in endless methods, with a parser generated by
|
|
16
16
|
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter), whose compact parse tables make the
|
|
17
|
-
parser smaller. The parser carries that fork's own ABI number (`
|
|
18
|
-
runtime; upstream's tree-sitter runtime rejects it. Use runtime
|
|
17
|
+
parser smaller. The parser carries that fork's own ABI number (`0x57420006`), so it loads only with the WillBooster
|
|
18
|
+
runtime; upstream's tree-sitter runtime rejects it. Use runtime 7.0.5 or later.
|
|
19
19
|
The scanner preserves long heredoc identifiers
|
|
20
20
|
when their state fits the runtime's serialization buffer. If the open heredocs cannot fit, their bodies are parsed as
|
|
21
21
|
code instead of aborting the process.
|
|
@@ -24,7 +24,7 @@ code instead of aborting the process.
|
|
|
24
24
|
|
|
25
25
|
The npm package ships `tree-sitter-ruby.wasm` for
|
|
26
26
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
27
|
-
browsers, and Cloudflare Workers. The parser requires runtime
|
|
27
|
+
browsers, and Cloudflare Workers. The parser requires runtime 7.0.5 or later.
|
|
28
28
|
|
|
29
29
|
In Node.js and Bun, load the grammar from its path:
|
|
30
30
|
|
|
@@ -67,12 +67,12 @@ The package also ships the queries in `queries/` and the node types in `src/node
|
|
|
67
67
|
|
|
68
68
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-ruby) and on
|
|
69
69
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
70
|
-
fuzzed with. The parser requires runtime
|
|
70
|
+
fuzzed with. The parser requires runtime 7.0.5 or later:
|
|
71
71
|
|
|
72
72
|
```toml
|
|
73
73
|
[dependencies]
|
|
74
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
75
|
-
tree-sitter-ruby = { package = "willbooster-tree-sitter-ruby", version = "
|
|
74
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
|
|
75
|
+
tree-sitter-ruby = { package = "willbooster-tree-sitter-ruby", version = "3" }
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
```rust
|
package/grammar.js
CHANGED
|
@@ -1652,11 +1652,19 @@ module.exports = grammar({
|
|
|
1652
1652
|
'->',
|
|
1653
1653
|
field(
|
|
1654
1654
|
'parameters',
|
|
1655
|
-
optional(
|
|
1655
|
+
optional(
|
|
1656
|
+
choice(
|
|
1657
|
+
alias($._parenthesized_lambda_parameters, $.lambda_parameters),
|
|
1658
|
+
alias($.bare_parameters, $.lambda_parameters)
|
|
1659
|
+
)
|
|
1660
|
+
)
|
|
1656
1661
|
),
|
|
1657
1662
|
field('body', choice($.block, $.do_block))
|
|
1658
1663
|
),
|
|
1659
1664
|
|
|
1665
|
+
_parenthesized_lambda_parameters: ($) =>
|
|
1666
|
+
seq('(', commaSep($._formal_parameter), optional(seq(';', sep1(field('locals', $.identifier), ','))), ')'),
|
|
1667
|
+
|
|
1660
1668
|
empty_statement: () => prec(-1, ';'),
|
|
1661
1669
|
|
|
1662
1670
|
_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
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Ruby grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
48
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
49
|
"@willbooster/wb": "22.26.1",
|
|
50
|
-
"@willbooster/web-tree-sitter": "
|
|
50
|
+
"@willbooster/web-tree-sitter": "7.0.5",
|
|
51
51
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
52
52
|
"lefthook": "2.2.1",
|
|
53
53
|
"oxfmt": "0.72.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"wrangler": "4.149.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@willbooster/web-tree-sitter": "^
|
|
65
|
+
"@willbooster/web-tree-sitter": "^7.0.5"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@willbooster/web-tree-sitter": {
|
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
|