@willbooster/tree-sitter-python 5.2.0 → 6.0.1
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 -4
- package/package.json +3 -3
- 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
|
@@ -90,12 +90,14 @@ module.exports = grammar({
|
|
|
90
90
|
// if no dedent is expected.
|
|
91
91
|
sym('comment'),
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
// so that it can avoid returning dedent tokens between brackets.
|
|
95
|
-
']',
|
|
93
|
+
'(',
|
|
96
94
|
')',
|
|
95
|
+
'[',
|
|
96
|
+
']',
|
|
97
|
+
'{',
|
|
97
98
|
'}',
|
|
98
99
|
'except',
|
|
100
|
+
sym('_format_specifier_content'),
|
|
99
101
|
],
|
|
100
102
|
|
|
101
103
|
inline: ($) => [
|
|
@@ -977,7 +979,7 @@ module.exports = grammar({
|
|
|
977
979
|
format_specifier: ($) =>
|
|
978
980
|
seq(
|
|
979
981
|
token(prec(1, ':')),
|
|
980
|
-
repeat(choice(
|
|
982
|
+
repeat(choice(sym('_format_specifier_content'), alias($.interpolation, sym('format_expression'))))
|
|
981
983
|
),
|
|
982
984
|
|
|
983
985
|
type_conversion: () => /![a-z]/,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-python",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
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/tree-sitter-python.wasm
CHANGED
|
Binary file
|