Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ tree-sitter-language = "0.1"
cc = "1.2"

[dev-dependencies]
tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
tree-sitter = { package = "willbooster-tree-sitter", version = "10.0.2" }
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ to its authors and contributors. This is not an official release of that project
This fork builds on upstream v0.25.0 with grammar, scanner, and highlighting fixes, including Python 3.15
unpacking comprehensions. It ships a compact parser generated by the parser generator of
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter). The parser carries that fork's own ABI number, so
it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`) 7.x,
it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`) 10.0.2 or later within 10.x,
not with upstream's tree-sitter.

## Usage

The npm package ships `tree-sitter-python.wasm` for
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
browsers, and Cloudflare Workers. The parser requires runtime 7.x.
browsers, and Cloudflare Workers. The parser requires runtime 10.0.2 or later within 10.x.

In Node.js and Bun, load the grammar from its path:

Expand Down Expand Up @@ -67,12 +67,12 @@ Qualified generic bases use `member_type` inside `generic_type`. Generic bases i

In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-python) and on
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
fuzzed with. The parser requires runtime 7.x:
fuzzed with. The parser requires runtime 10.0.2 or later within 10.x:

```toml
[dependencies]
tree-sitter = { package = "willbooster-tree-sitter", version = "7" }
tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "6" }
tree-sitter = { package = "willbooster-tree-sitter", version = "10.0.2" }
tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "9" }
```

```rust
Expand Down
4 changes: 2 additions & 2 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This crate provides Python language support for the [tree-sitter] parsing library.
//!
//! The parser loads only with the WillBooster runtime, the [willbooster-tree-sitter] crate 7.x.
//! The parser loads only with the WillBooster runtime, the [willbooster-tree-sitter] crate 10.0.2 or later within 10.x.
//!
//! Typically, you will use the [`LANGUAGE`] constant to add this language to a
//! tree-sitter [`Parser`], and then use the parser to parse some code:
Expand All @@ -16,7 +16,7 @@
//! assert!(!tree.root_node().has_error());
//! ```
//!
//! [`Parser`]: https://docs.rs/willbooster-tree-sitter/7/tree_sitter/struct.Parser.html
//! [`Parser`]: https://docs.rs/willbooster-tree-sitter/10/tree_sitter/struct.Parser.html
//! [tree-sitter]: https://tree-sitter.github.io/
//! [willbooster-tree-sitter]: https://crates.io/crates/willbooster-tree-sitter

Expand Down
6 changes: 3 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@willbooster/oxfmt-config": "1.2.2",
"@willbooster/oxlint-config": "1.4.8",
"@willbooster/wb": "22.26.2",
"@willbooster/web-tree-sitter": "7.0.5",
"@willbooster/web-tree-sitter": "10.0.2",
"conventional-changelog-conventionalcommits": "10.4.1",
"lefthook": "2.2.2",
"oxfmt": "0.73.0",
Expand All @@ -61,7 +61,7 @@
"wrangler": "4.149.0"
},
"peerDependencies": {
"@willbooster/web-tree-sitter": "^7.0.5"
"@willbooster/web-tree-sitter": "^10.0.2"
},
"peerDependenciesMeta": {
"@willbooster/web-tree-sitter": {
Expand Down
2 changes: 1 addition & 1 deletion script/generate
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ while IFS= read -r grammar; do
script/tree-sitter profile --grammar-path "$grammar" --output "$profile" "${training[@]}"
script/tree-sitter generate "$grammar/grammar.js" --profile "$profile"
if [[ ${1:-} == --build-wasm ]]; then
script/tree-sitter build --wasm "$grammar"
script/tree-sitter build --wasm --optimization z "$grammar"
fi
backup=
rm -rf "$workspace/src"
Expand Down
Loading
Loading