@willbooster/tree-sitter-rust 5.0.0 → 7.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 CHANGED
@@ -18,8 +18,8 @@ This fork fixes parsing bugs and raises conformance with [The Rust Reference](ht
18
18
 
19
19
  The npm package ships `tree-sitter-rust.wasm` for
20
20
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
21
- browsers, and Cloudflare Workers. The parser loads only with that runtime, version 2.0.0 or later: it carries the
22
- WillBooster ABI number, which upstream's `web-tree-sitter` rejects.
21
+ browsers, and Cloudflare Workers. The parser requires version 7.0.5 or later within major version 7 of that runtime.
22
+ It carries the WillBooster ABI number, which upstream's `web-tree-sitter` rejects.
23
23
 
24
24
  In Node.js and Bun, load the grammar from its path:
25
25
 
@@ -68,12 +68,13 @@ documentation or line documentation for fenced examples with these queries.
68
68
 
69
69
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-rust) and on
70
70
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
71
- fuzzed with. The parser loads only with that runtime, version 2.0.0 or later; upstream's `tree-sitter` crate rejects it:
71
+ fuzzed with. The parser requires version 7.0.5 or later within major version 7 of that runtime; upstream's
72
+ `tree-sitter` crate rejects it:
72
73
 
73
74
  ```toml
74
75
  [dependencies]
75
- tree-sitter = { package = "willbooster-tree-sitter", version = "2" }
76
- tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "5" }
76
+ tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
77
+ tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "7" }
77
78
  ```
78
79
 
79
80
  ```rust
package/grammar.js CHANGED
@@ -195,7 +195,6 @@ module.exports = grammar({
195
195
  [$._type, $._pattern],
196
196
  [$.unit_type, $.tuple_pattern],
197
197
  [$.scoped_identifier, $.scoped_type_identifier],
198
- [$.parameters, $._pattern],
199
198
  [$.parameters, $.tuple_struct_pattern],
200
199
  [$.visibility_modifier],
201
200
  [$.visibility_modifier, $.scoped_identifier, $.scoped_type_identifier],
@@ -821,10 +820,7 @@ module.exports = grammar({
821
820
  parameters: ($) =>
822
821
  seq(
823
822
  '(',
824
- sepBy(
825
- ',',
826
- seq(repeat($.attribute_item), choice($.parameter, $.self_parameter, $.variadic_parameter, '_', $._type))
827
- ),
823
+ sepBy(',', seq(repeat($.attribute_item), choice($.parameter, $.self_parameter, $.variadic_parameter, $._type))),
828
824
  optional(','),
829
825
  optional(alias($._orphan_doc_expression, $.attributed_expression)),
830
826
  ')'
@@ -857,6 +853,7 @@ module.exports = grammar({
857
853
  $.array_type,
858
854
  $.function_type,
859
855
  $._type_identifier_in_type_position,
856
+ alias('_', sym('type_identifier')),
860
857
  $.macro_invocation,
861
858
  $.never_type,
862
859
  $.dynamic_type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Rust 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": "2.0.27",
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",
@@ -61,7 +61,7 @@
61
61
  "wrangler": "4.149.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@willbooster/web-tree-sitter": "^2.0.0"
64
+ "@willbooster/web-tree-sitter": "^7.0.5"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -25,7 +25,7 @@
25
25
  }
26
26
  ],
27
27
  "metadata": {
28
- "version": "5.0.0",
28
+ "version": "7.0.0",
29
29
  "license": "MIT",
30
30
  "description": "Rust grammar for tree-sitter",
31
31
  "authors": [