Repository navigation
Improve Python 3.15 parser diagnostics and recovery - #7
Draft
youknowdot wants to merge 7 commits into
Draft
youknowdot wants to merge 7 commits into
youknowdot wants to merge 7 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Oct 24, 2026
youknowdot
force-pushed
the
pep798-unpacking-operands-315
branch
from
November 13, 2026 05:41
90bd525 to
19a5e16
Compare
youknowone
changed the base branch from
rustpython-0.17.1
to
rustpython-0.17.5
November 13, 2026 05:42
This was referenced Nov 13, 2026
Parse full expression operands in dictionary and starred generator comprehensions. Preserve conditional-unpacking fallback ordering and recover malformed dictionary unpacking without invalid AST ranges. Add parser fixtures and regenerated snapshots. Assisted-by: OpenAI Codex:model version unavailable
Update parameter terminology and repeated-star wording without changing parameter parsing or recovered syntax. Regenerate affected snapshots. Assisted-by: OpenAI Codex:model-version-unavailable
Diagnose standalone case clauses, assertion assignments, mapping rest ordering and misplaced lazy imports. Preserve ordinary recovered ASTs and restore speculative recovery state, including lexical-error paths. Assisted-by: OpenAI Codex:model-version-unavailable
Project multiline literal-concatenation diagnostics onto the final literal line while retaining original expression ranges for lexical error precedence. Assisted-by: OpenAI Codex:model-version-unavailable
Report the opening brace line for multiline f-string and t-string replacement fields. Track lexical hint boundaries without changing recovered syntax or existing PEP 798 deferred-error state. Assisted-by: OpenAI Codex:model-version-unavailable
youknowdot
force-pushed
the
pep798-unpacking-operands-315
branch
from
November 14, 2026 04:16
7e5c901 to
cd0390f
Compare
This branch has not been deployed
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.
Summary
Improve selected CPython 3.15 parser diagnostics and error recovery on the RustPython 0.17.5 parser branch.
else **value.caseclauses, assertion assignment/walrus syntax, mapping-rest ordering, and misplacedlazyimports receive specific diagnostics.Scope
This PR does not expand accepted PEP 798 operand grammar. General unparenthesized operands in dictionary comprehensions and parenthesized starred generators remain upstream work: astral-sh#30406 and astral-sh#30418. The current upstream PR addresses dictionary comprehensions, not the generator example reported in the issue. This diagnostic patch is not a substitute for those syntax fixes.
Parenthesized operands and already-supported call forms remain covered. Tests for deferred and speculative errors use grammar already accepted by the base parser. Existing upstream fixtures are retained; grammar-expansion-only fixtures introduced on this branch are excluded rather than recording the known upstream rejection as correct behavior.
The diagnostic implementation references CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc, including its grammar, replacement-field tests, and syntax tests. No new Cargo feature or diagnostic version gate is introduced. Complete CPython diagnostic parity is not claimed.This builds on
rustpython-0.17.5at043bd2bc4898a5348f66332c5cdd19de4fbecbe1. RustPython consumers still need the resulting revision and separate compiler/VM integration. No dependency pin or crates.io release is changed here.Validation
At
cd0390f5cb46db24d4d64d133c2155a05727af54:--no-deps.Dependency-wide strict Clippy remains blocked by nine existing disabled
cache/salsaconfiguration warnings in the unchanged AST dependency. RustPython runtime/compiler integration and the earlier finite CPython comparison were not rerun for this reduced-scope head; earlier results do not establish full compatibility of this revision.Assistance
Prepared and tested with OpenAI Codex at the maintainer's explicit request for the RustPython-managed fork. No claim of manual maintainer review is implied.