Repository navigation
Add per-parse runtime hooks for Unicode names and literal diagnostics - #9
Draft
youknowone wants to merge 1 commit into
Draft
youknowone wants to merge 1 commit into
youknowone wants to merge 1 commit 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. |
Keep decoder failures across diagnostic backtracking and dispatch literal warnings in grammar action order. Preserve format-spec exception provenance and retain standalone parser behavior. Assisted-by: Codex:gpt-6.1-sol
youknowdot
force-pushed
the
unicode-name-provider
branch
from
November 14, 2026 05:02
3abeb93 to
71f341c
Compare
youknowone
force-pushed
the
pr-7-runtime-base
branch
from
November 14, 2026 10:10
19a5e16 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
Add borrowed
UnicodeNameProviderandParseRuntimehooks plusparse_unchecked_with_runtime, keeping existing parse APIs and options unchanged. Unicode preparation occurs at actual named-escape decoding, before name validation; successful literal decoding can dispatch VM warnings. No thread-local state or raw-source rescanning is used.Decoder abort survives diagnostic checkpoints and suppresses subsequent runtime effects. Ordinary strings, outer f/t-string fragments, and immediate format-spec fragments follow distinct CPython 3.15 semantic-action boundaries.
FormatSpecDecodeErrorpreserves the distinction needed by downstream callers for bare Unicode errors.Dependency and integration
Depends on #7, exact head
cd0390f5cb46db24d4d64d133c2155a05727af54. The temporary basepr-7-runtime-basepoints to that commit. If #7 changes, this staging base becomes stale and must be reconciled. After #7 merges, retarget this PR torustpython-0.17.5.The rebase preserves the runtime-hook change without restoring #7's removed PEP 798 accepted-grammar extensions; those remain upstream work.
This is parser API work only: RustPython compiler/VM wiring and dependency updates are separate. Existing scalar-only AST surrogate replacement remains a limitation. This is not a claim of complete CPython equivalence.
Verification
After rebasing onto the reduced-scope #7, at head
71f341c445617704d514f0532a4aedd8122f3c7e:--no-depspassed; existing AST dependency cfg warnings remain.range-diffmatched); the finite oracle comparison was not rerun for this head. Full Ruff workspace and downstream runtime integration were not tested.AI assistance: OpenAI Codex implemented and reviewed this change.