Repository navigation
Add per-parse runtime hooks for Unicode names and literal diagnostics - #9
Draft
youknowone wants to merge 9 commits into
Draft
youknowone wants to merge 9 commits into
youknowone wants to merge 9 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. |
`from <dotted_name> lazy import` is reported as "use 'lazy from ... ' instead of 'from ... lazy import'", pointed at the `lazy` token, and `lazy` is consumed so the rest of the import still parses. Assisted-by: Grok
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
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
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
19a5e1633451b1f5c28e47f274c72cc854ce6bc4. 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.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
--no-depspassed; existing AST dependency cfg warnings remain.AI assistance: OpenAI Codex implemented and reviewed this change.