Repository navigation
Complete PEP 798 unpacking operands and diagnostics - #7
Draft
youknowdot wants to merge 1 commit into
Draft
youknowdot wants to merge 1 commit into
youknowdot wants to merge 1 commit into
Conversation
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
|
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. Comment |
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
Complete PEP 798 unpacking operands on the RustPython 0.17.1 parser branch. Dictionary comprehensions and starred generator expressions accept full expressions, including conditional expressions. Malformed unpacking preserves the first relevant diagnostic and recovers without producing invalid AST ranges.
The production changes are limited to the parser's expression parsing, error definitions, and deferred-error state. Thirteen fixtures and regenerated snapshots cover conditional/Boolean/comparison operands, nested contexts, soft keywords, invalid unpacking positions, and subsequent syntax errors.
Behavior is compared with CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc. This is the narrow operand/diagnostic prerequisite for RustPython's PEP 798 compiler changes. It builds onrustpython-0.17.1; the broader older-version work in #6 remains separate.Validation
--no-deps.unexpected_cfgsdiagnostics forcache/salsain the AST dependency. The same nine diagnostics were reproduced on unchanged base9290a8849542134d83f77e9360e7f0b93897fd93.test_unpack_exsuite, also run on the pinned CPython oracle.The integration results include RustPython compiler changes outside this parser PR; this PR alone does not implement the VM/code-generation portion of PEP 798. Git dependency consumers need to select the resulting revision; this does not establish a crates.io release.
Assistance
Prepared and tested with OpenAI Codex at the maintainer's explicit request. No claim of manual maintainer review is implied.