@willbooster/tree-sitter-dart 2.0.0 → 3.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 +6 -6
- package/grammar.js +5 -3
- package/package.json +8 -8
- package/tree-sitter-dart.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-dart/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-dart/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-dart)
|
|
10
10
|
|
|
11
11
|
Dart grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -13,8 +13,8 @@ Dart grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), fork
|
|
|
13
13
|
to its authors and contributors. This is not an official release of that project.
|
|
14
14
|
|
|
15
15
|
This fork extends upstream's version 0.2.0 grammar, retains its external scanner, and generates the parser with the
|
|
16
|
-
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI number (`
|
|
17
|
-
version
|
|
16
|
+
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI number (`0x57420007`), so it loads only with the fork's runtime,
|
|
17
|
+
version 10.0.2 or later in the 10.x series; upstream's runtime rejects it, and the fork's runtime rejects parsers generated by upstream's CLI.
|
|
18
18
|
|
|
19
19
|
## Differences from upstream's parser
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ Known differences from upstream's 0.2.0 parser include:
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
33
|
The npm package ships `tree-sitter-dart.wasm` for
|
|
34
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version
|
|
34
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 10.0.2 or later in the 10.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
|
|
35
35
|
In Node.js and Bun, load the grammar from its path:
|
|
36
36
|
|
|
37
37
|
```js
|
|
@@ -78,8 +78,8 @@ fuzzed with:
|
|
|
78
78
|
|
|
79
79
|
```toml
|
|
80
80
|
[dependencies]
|
|
81
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
82
|
-
tree-sitter-dart = { package = "willbooster-tree-sitter-dart", version = "
|
|
81
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "10.0.2" }
|
|
82
|
+
tree-sitter-dart = { package = "willbooster-tree-sitter-dart", version = "3" }
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
```rust
|
package/grammar.js
CHANGED
|
@@ -154,7 +154,6 @@ module.exports = grammar({
|
|
|
154
154
|
// [$._type_name, $._primary, $.assignable_expression], -- subsumed
|
|
155
155
|
// Parameter ambiguities
|
|
156
156
|
[$._normal_formal_parameters],
|
|
157
|
-
[$._normal_formal_parameter],
|
|
158
157
|
[$.typed_identifier, $._var_or_type, $._function_formal_parameter],
|
|
159
158
|
[$.record_type_field, $._function_formal_parameter, $._var_or_type],
|
|
160
159
|
[$.record_type_field, $._var_or_type, $._final_var_or_type, $._function_formal_parameter],
|
|
@@ -1382,20 +1381,23 @@ module.exports = grammar({
|
|
|
1382
1381
|
seq(
|
|
1383
1382
|
optional($._metadata),
|
|
1384
1383
|
optional("required"),
|
|
1385
|
-
$.formal_parameter,
|
|
1384
|
+
alias($._unannotated_formal_parameter, $.formal_parameter),
|
|
1386
1385
|
optional(seq(choice("=", ":"), $._expression)),
|
|
1387
1386
|
),
|
|
1388
1387
|
|
|
1389
1388
|
_normal_formal_parameter: ($) =>
|
|
1390
1389
|
seq(
|
|
1391
1390
|
optional($._metadata),
|
|
1391
|
+
$._unannotated_formal_parameter,
|
|
1392
|
+
),
|
|
1393
|
+
|
|
1394
|
+
_unannotated_formal_parameter: ($) =>
|
|
1392
1395
|
choice(
|
|
1393
1396
|
$._function_formal_parameter,
|
|
1394
1397
|
$._simple_formal_parameter,
|
|
1395
1398
|
$.constructor_param,
|
|
1396
1399
|
$.super_formal_parameter,
|
|
1397
1400
|
),
|
|
1398
|
-
),
|
|
1399
1401
|
|
|
1400
1402
|
_function_formal_parameter: ($) =>
|
|
1401
1403
|
seq(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-dart",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Dart grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@tsconfig/bun": "1.0.11",
|
|
45
|
-
"@types/bun": "1.4.
|
|
45
|
+
"@types/bun": "1.4.3",
|
|
46
46
|
"@vitest/browser-playwright": "5.0.3",
|
|
47
47
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
48
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
|
-
"@willbooster/wb": "22.26.
|
|
50
|
-
"@willbooster/web-tree-sitter": "
|
|
49
|
+
"@willbooster/wb": "22.26.2",
|
|
50
|
+
"@willbooster/web-tree-sitter": "10.0.2",
|
|
51
51
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
52
|
-
"lefthook": "2.2.
|
|
53
|
-
"oxfmt": "0.
|
|
54
|
-
"oxlint": "1.
|
|
52
|
+
"lefthook": "2.2.2",
|
|
53
|
+
"oxfmt": "0.73.0",
|
|
54
|
+
"oxlint": "1.88.0",
|
|
55
55
|
"oxlint-tsgolint": "7.0.2004",
|
|
56
56
|
"playwright": "1.63.0",
|
|
57
57
|
"semantic-release": "25.0.9",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"wrangler": "4.147.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@willbooster/web-tree-sitter": "^
|
|
63
|
+
"@willbooster/web-tree-sitter": "^10.0.2"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-dart.wasm
CHANGED
|
Binary file
|