@willbooster/tree-sitter-ruby 1.0.0 → 2.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 +11 -8
- package/package.json +3 -3
- package/tree-sitter-ruby.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# @willbooster/tree-sitter-ruby
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-ruby)
|
|
4
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-ruby)
|
|
3
5
|
[](https://github.com/WillBooster/tree-sitter-ruby/actions/workflows/test.yml)
|
|
4
6
|
[](https://github.com/WillBooster/tree-sitter-ruby/actions/workflows/test-rust.yml)
|
|
5
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
7
9
|
[](https://crates.io/crates/willbooster-tree-sitter-ruby)
|
|
8
10
|
|
|
9
11
|
Ruby grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -11,8 +13,9 @@ Ruby grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), fork
|
|
|
11
13
|
to its authors and contributors. This is not an official release of that project.
|
|
12
14
|
|
|
13
15
|
This fork ships upstream's grammar with a parser generated by
|
|
14
|
-
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter), whose compact
|
|
15
|
-
parser smaller. The
|
|
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 (`0x57420001`), so it loads only with the WillBooster
|
|
18
|
+
runtime, version 2.0.0 or later; upstream's tree-sitter runtime rejects it. The scanner differs from upstream's only where upstream's code aborts the process: when a heredoc word is
|
|
16
19
|
longer than 255 bytes, or when the scanner state with the open heredocs would not fit the runtime's serialization
|
|
17
20
|
buffer, the open heredocs are not recognized and their bodies are parsed as code.
|
|
18
21
|
|
|
@@ -20,7 +23,7 @@ buffer, the open heredocs are not recognized and their bodies are parsed as code
|
|
|
20
23
|
|
|
21
24
|
The npm package ships `tree-sitter-ruby.wasm` for
|
|
22
25
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
23
|
-
browsers, and Cloudflare Workers. The
|
|
26
|
+
browsers, and Cloudflare Workers. The parser requires runtime 2.0.0 or later.
|
|
24
27
|
|
|
25
28
|
In Node.js and Bun, load the grammar from its path:
|
|
26
29
|
|
|
@@ -63,12 +66,12 @@ The package also ships the queries in `queries/` and the node types in `src/node
|
|
|
63
66
|
|
|
64
67
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-ruby) and on
|
|
65
68
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
66
|
-
fuzzed with. The
|
|
69
|
+
fuzzed with. The parser requires runtime 2.0.0 or later:
|
|
67
70
|
|
|
68
71
|
```toml
|
|
69
72
|
[dependencies]
|
|
70
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
71
|
-
tree-sitter-ruby = { package = "willbooster-tree-sitter-ruby", version = "
|
|
73
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "2.0.0" }
|
|
74
|
+
tree-sitter-ruby = { package = "willbooster-tree-sitter-ruby", version = "2" }
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
```rust
|
|
@@ -93,7 +96,7 @@ not the ones this package ships with. Its first run downloads that CLI from the
|
|
|
93
96
|
with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no binary
|
|
94
97
|
that runs here. Run other CLI commands through it as well (e.g. `script/tree-sitter parse file.rb`).
|
|
95
98
|
|
|
96
|
-
`bun run generate` records a fresh
|
|
99
|
+
`bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
|
|
97
100
|
files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`.
|
|
98
101
|
After changing the grammar, `tree-sitter.json`, a corpus case, or a tracked example, regenerate and commit `src/`. Stage
|
|
99
102
|
added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-ruby",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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.24.0",
|
|
50
|
-
"@willbooster/web-tree-sitter": "
|
|
50
|
+
"@willbooster/web-tree-sitter": "2.0.1",
|
|
51
51
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
52
52
|
"lefthook": "2.1.16",
|
|
53
53
|
"oxfmt": "0.71.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"wrangler": "4.147.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@willbooster/web-tree-sitter": "^
|
|
66
|
+
"@willbooster/web-tree-sitter": "^2.0.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-ruby.wasm
CHANGED
|
Binary file
|