@willbooster/tree-sitter-ruby 12.0.0 → 14.0.0
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 +5 -5
- package/grammar.js +7 -3
- package/package.json +3 -3
- 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
|
|
17
|
+
parser smaller. The parser carries that fork's own ABI number (`0x5742000c`), so it loads only with the WillBooster
|
|
18
|
+
runtime 17.x; upstream's tree-sitter runtime and other major versions of the fork's runtime reject it.
|
|
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.
|
|
@@ -31,7 +31,7 @@ the trees that error recovery produces may change; such changes are released as
|
|
|
31
31
|
|
|
32
32
|
The npm package ships `tree-sitter-ruby.wasm` for
|
|
33
33
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
34
|
-
browsers, and Cloudflare Workers. The parser requires runtime
|
|
34
|
+
browsers, and Cloudflare Workers. The parser requires runtime 17.x.
|
|
35
35
|
|
|
36
36
|
In Node.js and Bun, load the grammar from its path:
|
|
37
37
|
|
|
@@ -75,10 +75,10 @@ The package also ships the node types in `src/node-types.json`.
|
|
|
75
75
|
|
|
76
76
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-ruby) and on
|
|
77
77
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
78
|
-
fuzzed with. The parser requires runtime
|
|
78
|
+
fuzzed with. The parser requires runtime 17.x:
|
|
79
79
|
|
|
80
80
|
```sh
|
|
81
|
-
cargo add willbooster-tree-sitter@
|
|
81
|
+
cargo add willbooster-tree-sitter@17.0.1 --rename tree-sitter
|
|
82
82
|
cargo add willbooster-tree-sitter-ruby --rename tree-sitter-ruby
|
|
83
83
|
```
|
|
84
84
|
|
package/grammar.js
CHANGED
|
@@ -276,7 +276,8 @@ module.exports = grammar({
|
|
|
276
276
|
),
|
|
277
277
|
choice(
|
|
278
278
|
seq(field('parameters', alias($.parameters, $.method_parameters)), optional($._terminator)),
|
|
279
|
-
seq(
|
|
279
|
+
seq(field('parameters', alias($.bare_parameters, $.method_parameters)), $._terminator),
|
|
280
|
+
$._body_separator
|
|
280
281
|
)
|
|
281
282
|
)
|
|
282
283
|
),
|
|
@@ -400,7 +401,7 @@ module.exports = grammar({
|
|
|
400
401
|
seq(
|
|
401
402
|
'class',
|
|
402
403
|
field('name', choice($.constant, $.scope_resolution)),
|
|
403
|
-
choice(seq(field('superclass', $.superclass), $.
|
|
404
|
+
choice(seq(field('superclass', $.superclass), $._terminator), optional($._terminator)),
|
|
404
405
|
optional(field('body', $.body_statement)),
|
|
405
406
|
'end'
|
|
406
407
|
),
|
|
@@ -412,7 +413,7 @@ module.exports = grammar({
|
|
|
412
413
|
'class',
|
|
413
414
|
alias($._singleton_class_left_angle_left_langle, '<<'),
|
|
414
415
|
field('value', $._arg),
|
|
415
|
-
$.
|
|
416
|
+
$._terminator,
|
|
416
417
|
optional(field('body', $.body_statement)),
|
|
417
418
|
'end'
|
|
418
419
|
),
|
|
@@ -1761,6 +1762,9 @@ module.exports = grammar({
|
|
|
1761
1762
|
|
|
1762
1763
|
empty_statement: () => prec(-1, ';'),
|
|
1763
1764
|
|
|
1765
|
+
// The scanner emits comments after this line break into the body even when only comments precede `end`. It follows
|
|
1766
|
+
// only a method name: after an expression, its validity would split the states of every expression from those of
|
|
1767
|
+
// other contexts.
|
|
1764
1768
|
_body_separator: ($) => choice(prec.dynamic(1, $._body_line_break), ';'),
|
|
1765
1769
|
|
|
1766
1770
|
_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": "14.0.0",
|
|
4
4
|
"description": "Ruby grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@vitest/browser-playwright": "5.0.5",
|
|
50
50
|
"@willbooster/oxlint-config": "1.4.9",
|
|
51
51
|
"@willbooster/wb": "23.0.2",
|
|
52
|
-
"@willbooster/web-tree-sitter": "
|
|
52
|
+
"@willbooster/web-tree-sitter": "17.0.1",
|
|
53
53
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
54
54
|
"lefthook": "2.2.2",
|
|
55
55
|
"oxlint": "1.89.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"wrangler": "4.152.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@willbooster/web-tree-sitter": "^
|
|
64
|
+
"@willbooster/web-tree-sitter": "^17.0.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-ruby.wasm
CHANGED
|
Binary file
|