Skip to content

Add per-parse runtime hooks for Unicode names and literal diagnostics - #9

Merged
youknowone merged 1 commit into
RustPython:rustpython-0.17.5from
youknowdot:unicode-name-provider
Nov 15, 2026
Merged

youknowone merged 1 commit into
RustPython:rustpython-0.17.5from
youknowdot:unicode-name-provider

Conversation

@youknowone

@youknowone youknowone commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Add interpreter runtime hooks at Python literal decoding boundaries on rustpython-0.17.5.

  • Provide borrowed UnicodeNameProvider and ParseRuntime interfaces and parse_unchecked_with_runtime.
  • Prepare named-Unicode lookup at the decoding boundary, and report successfully decoded literals to the embedding interpreter for warning handling.
  • Preserve decoder failures and callback ordering across parser backtracking, including invalid conditional expressions and f/t-string boundaries.
  • Leave ordinary parsing on the built-in Unicode database when no runtime is supplied.

The target branch already contains #7. This PR adds only the runtime-hook implementation and its focused tests; it does not duplicate #7 or add PEP 798 grammar support.

Validation

The complete parser test suite passes, including existing fixtures and snapshots, three diagnostic tests, twenty runtime-hook tests, and doctests. Parser all-target Clippy and changed-file checks pass with the pinned Rust 1.99.0 toolchain. Existing fixture snapshots are unchanged.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35e0a3b2-ac2d-4608-936f-df9b4ede5a90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@youknowdot
youknowdot force-pushed the unicode-name-provider branch from 3abeb93 to 71f341c Compare November 14, 2026 05:02
@youknowdot
youknowdot force-pushed the unicode-name-provider branch 3 times, most recently from 7a06ac3 to 38f9ce8 Compare November 14, 2026 16:43
@youknowone
youknowone changed the base branch from pr-7-runtime-base to main November 14, 2026 16:43
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
youknowdot force-pushed the unicode-name-provider branch from 38f9ce8 to 4f370b7 Compare November 14, 2026 17:00
@youknowone
youknowone changed the base branch from main to rustpython-0.17.5 November 14, 2026 17:00
@youknowone
youknowone marked this pull request as ready for review November 15, 2026 01:25
@youknowone
youknowone merged commit 9f3e734 into RustPython:rustpython-0.17.5 Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants