@willbooster/tree-sitter-python 5.1.0 → 6.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 +6 -2
- package/package.json +3 -3
- package/src/node-types.json +18 -18
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -15,14 +15,14 @@ to its authors and contributors. This is not an official release of that project
|
|
|
15
15
|
This fork builds on upstream v0.25.0 with grammar, scanner, and highlighting fixes, including Python 3.15
|
|
16
16
|
unpacking comprehensions. It ships a compact parser generated by the parser generator of
|
|
17
17
|
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter). The parser carries that fork's own ABI number, so
|
|
18
|
-
it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`)
|
|
18
|
+
it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`) 7.x,
|
|
19
19
|
not with upstream's tree-sitter.
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
The npm package ships `tree-sitter-python.wasm` for
|
|
24
24
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
25
|
-
browsers, and Cloudflare Workers. The parser requires runtime
|
|
25
|
+
browsers, and Cloudflare Workers. The parser requires runtime 7.x.
|
|
26
26
|
|
|
27
27
|
In Node.js and Bun, load the grammar from its path:
|
|
28
28
|
|
|
@@ -67,12 +67,12 @@ Qualified generic bases use `member_type` inside `generic_type`. Generic bases i
|
|
|
67
67
|
|
|
68
68
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-python) 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.x:
|
|
71
71
|
|
|
72
72
|
```toml
|
|
73
73
|
[dependencies]
|
|
74
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
75
|
-
tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "
|
|
74
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "7" }
|
|
75
|
+
tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "6" }
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
```rust
|
package/grammar.js
CHANGED
|
@@ -847,8 +847,12 @@ module.exports = grammar({
|
|
|
847
847
|
prec(
|
|
848
848
|
PREC.typed_parameter,
|
|
849
849
|
choice(
|
|
850
|
-
seq(choice($.identifier, $.dictionary_splat_pattern), ':', field('type', $.type)),
|
|
851
|
-
seq(
|
|
850
|
+
seq(field('name', choice($.identifier, $.dictionary_splat_pattern)), ':', field('type', $.type)),
|
|
851
|
+
seq(
|
|
852
|
+
field('name', $.list_splat_pattern),
|
|
853
|
+
':',
|
|
854
|
+
field('type', choice($.type, alias($._default_splat_type, $.splat_type)))
|
|
855
|
+
)
|
|
852
856
|
)
|
|
853
857
|
),
|
|
854
858
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-python",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Python 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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"wrangler": "4.149.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@willbooster/web-tree-sitter": "^
|
|
64
|
+
"@willbooster/web-tree-sitter": "^7.0.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@willbooster/web-tree-sitter": {
|
package/src/node-types.json
CHANGED
|
@@ -3361,6 +3361,24 @@
|
|
|
3361
3361
|
"type": "typed_parameter",
|
|
3362
3362
|
"named": true,
|
|
3363
3363
|
"fields": {
|
|
3364
|
+
"name": {
|
|
3365
|
+
"multiple": false,
|
|
3366
|
+
"required": true,
|
|
3367
|
+
"types": [
|
|
3368
|
+
{
|
|
3369
|
+
"type": "dictionary_splat_pattern",
|
|
3370
|
+
"named": true
|
|
3371
|
+
},
|
|
3372
|
+
{
|
|
3373
|
+
"type": "identifier",
|
|
3374
|
+
"named": true
|
|
3375
|
+
},
|
|
3376
|
+
{
|
|
3377
|
+
"type": "list_splat_pattern",
|
|
3378
|
+
"named": true
|
|
3379
|
+
}
|
|
3380
|
+
]
|
|
3381
|
+
},
|
|
3364
3382
|
"type": {
|
|
3365
3383
|
"multiple": false,
|
|
3366
3384
|
"required": true,
|
|
@@ -3375,24 +3393,6 @@
|
|
|
3375
3393
|
}
|
|
3376
3394
|
]
|
|
3377
3395
|
}
|
|
3378
|
-
},
|
|
3379
|
-
"children": {
|
|
3380
|
-
"multiple": false,
|
|
3381
|
-
"required": true,
|
|
3382
|
-
"types": [
|
|
3383
|
-
{
|
|
3384
|
-
"type": "dictionary_splat_pattern",
|
|
3385
|
-
"named": true
|
|
3386
|
-
},
|
|
3387
|
-
{
|
|
3388
|
-
"type": "identifier",
|
|
3389
|
-
"named": true
|
|
3390
|
-
},
|
|
3391
|
-
{
|
|
3392
|
-
"type": "list_splat_pattern",
|
|
3393
|
-
"named": true
|
|
3394
|
-
}
|
|
3395
|
-
]
|
|
3396
3396
|
}
|
|
3397
3397
|
},
|
|
3398
3398
|
{
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|