@willbooster/tree-sitter-python 18.0.0 → 20.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
@@ -15,22 +15,22 @@ 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 and scanner 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). Its ABI (`0x5742000c`) rejects upstream
18
- Tree-sitter runtimes. The parser requires `willbooster-tree-sitter` or `@willbooster/web-tree-sitter` 19.1.1 or later
19
- within 19.x: 17.x and 18.x WillBooster runtimes share ABI `0x5742000c` and pass the ABI check, whereas 19.1.0+ omits
20
- unused `TSLanguage` tables that pre-19.1.0 runtimes dereference.
18
+ Tree-sitter runtimes. Use this parser with `willbooster-tree-sitter` or `@willbooster/web-tree-sitter` 20.0.0 or later
19
+ within 20.x, the runtime line it is tested and fuzzed with: pre-19.1.0 WillBooster runtimes share ABI `0x5742000c` and
20
+ pass the ABI check, while dereferencing `TSLanguage` tables that this parser omits.
21
21
 
22
22
  ## Support Scope
23
23
 
24
24
  This fork maintains only full parsing: valid input yields a correct tree, and invalid input yields `ERROR` or `MISSING`
25
- nodes without crashing, hanging, or taking more than linear time. Incremental parsing works as in upstream tree-sitter
26
- but is not tested here, and no queries (highlights, locals, injections, tags) are shipped. Node types, field names, and
27
- the trees that error recovery produces may change; such changes are released as new major versions.
25
+ nodes without crashing, hanging, or taking more than linear time. Incremental parsing and queries (highlights, locals,
26
+ injections, tags) are not supported. Node types, field names, and the trees that error recovery produces may change;
27
+ such changes are released as new major versions.
28
28
 
29
29
  ## Usage
30
30
 
31
31
  The npm package ships `tree-sitter-python.wasm` for
32
32
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
33
- browsers, and Cloudflare Workers. The parser requires `@willbooster/web-tree-sitter` 19.1.1 or later within 19.x.
33
+ browsers, and Cloudflare Workers. Package peer dependencies require `@willbooster/web-tree-sitter` `^20.0.0`.
34
34
 
35
35
  In Node.js and Bun, load the grammar from its path:
36
36
 
@@ -75,11 +75,10 @@ The package also ships the node types in `src/node-types.json`.
75
75
  Qualified generic bases use `member_type` inside `generic_type`. Generic bases in annotations also recognize the contextual identifier spellings `match`, `print`, `exec` and `lazy`, while ordinary value subscripts retain their expression trees. Plain qualified generic arguments also expose `member_type` inside their `type` operand. Structured unpacked annotations and unpacked generic arguments use a `type` child inside `splat_type`. Expression-valued starred parameter annotations, such as `*args: *factory()`, keep a direct expression child instead. Ordinary value unpacks keep their expression tree.
76
76
 
77
77
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-python) and on
78
- [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
79
- fuzzed with. The parser requires `willbooster-tree-sitter` 19.1.1 or later within 19.x:
78
+ [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) 20.0.0 or later within 20.x:
80
79
 
81
80
  ```sh
82
- cargo add willbooster-tree-sitter@19.1.1 --rename tree-sitter
81
+ cargo add willbooster-tree-sitter@20.0.0 --rename tree-sitter
83
82
  cargo add willbooster-tree-sitter-python --rename tree-sitter-python
84
83
  ```
85
84
 
package/grammar.js CHANGED
@@ -24,8 +24,8 @@ const PREC = {
24
24
  not: 12,
25
25
  compare: 13,
26
26
  bitwise_or: 14,
27
- bitwise_and: 15,
28
- xor: 16,
27
+ xor: 15,
28
+ bitwise_and: 16,
29
29
  shift: 17,
30
30
  plus: 18,
31
31
  times: 19,
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-python",
3
- "version": "18.0.0",
3
+ "version": "20.0.0",
4
4
  "description": "Python grammar for tree-sitter",
5
5
  "keywords": [
6
- "incremental",
7
6
  "parsing",
8
7
  "python",
9
8
  "tree-sitter"
@@ -49,7 +48,7 @@
49
48
  "@vitest/browser-playwright": "5.0.5",
50
49
  "@willbooster/oxlint-config": "1.4.9",
51
50
  "@willbooster/wb": "23.3.0",
52
- "@willbooster/web-tree-sitter": "19.1.1",
51
+ "@willbooster/web-tree-sitter": "20.0.0",
53
52
  "conventional-changelog-conventionalcommits": "10.4.1",
54
53
  "lefthook": "2.2.2",
55
54
  "oxlint": "1.90.0",
@@ -61,7 +60,7 @@
61
60
  "wrangler": "4.156.0"
62
61
  },
63
62
  "peerDependencies": {
64
- "@willbooster/web-tree-sitter": "^19.1.1"
63
+ "@willbooster/web-tree-sitter": "^20.0.0"
65
64
  },
66
65
  "peerDependenciesMeta": {
67
66
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "18.0.0",
16
+ "version": "20.0.0",
17
17
  "license": "MIT",
18
18
  "description": "Python grammar for tree-sitter",
19
19
  "authors": [