Repository navigation
feat!: generate the Python grammar for runtime 7 ABI 6 - #35
Merged
Merged
Conversation
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The published Python grammar cannot be set on runtime 7: its language version is
0x57420001, while the current runtime requires0x57420006. This addresses the Python portion ofWillBooster/tree-sitter#213by regenerating both native and Wasm artifacts with the current published toolchain.Requirements
Customer Summary
The Python Wasm grammar and Rust crate load with the current WillBooster runtime 7. Consumers must use runtime 7.x with the new major grammar version.
Technical Summary
The dependency manifests and lockfiles select runtime 7.0.5. Canonical generation updates
src/parser.cand its generated headers to ABI 6. Runtime and crate examples document the new compatible versions. Grammar rules and shipped queries are unchanged.Three existing invalid-source expectations follow the new runtime: incomplete trailing backslashes stay inside their error ranges instead of becoming EOF-matching continuation tokens, and reserved-keyword recovery gives the malformed dot its own error node. Literal NUL controls confirm that the existing NUL token alternative no longer matches EOF.
Testing
bun run build/ciusing the official released CLI 7.0.5; generated language version is0x57420006.TREE_SITTER_ITERATIONS=100 TREE_SITTER_EDITS=5 bun wb test test/unit/incremental.test.ts: passes across the corpus.cargo test --locked: the Rust binding test and parsing doctest pass.bun run verifypasses.Parser.setLanguageon runtime 7 with the expected ABI error; the regenerated artifact loads and parses through the tests above.Notes
Seven existing code-gauge errors remain outside this change: Python2 example
GrammarTests.testFuncdefin both newline variants (159 NCSS), Python3 exampleGrammarTests.testFuncdefin both variants (187 NCSS), the Python3.8 example file (1,200 NCSS) and itstest_funcdef(232 NCSS), and the external scanner dispatch (complexity 175/202 NCSS). Refactoring imported fixtures or the unrelated scanner would expand this ABI migration. Forty-six existing warnings remain. The intentional LF/CRLF example duplicates would be suitable for a code-gauge exclusion; no exclusion configuration is added. Canonical generated C retains the generator's trailing whitespace, so a plaingit diff --checkreports it.