Repository navigation
Match obsolete comparison diagnostics - #9074
youknowdot 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. Comment |
| if let Some(error) = parse_error | ||
| && let Some(range) = self.invalid_legacy_operator(error) | ||
| { | ||
| if error.location.start() > range.start() { |
There was a problem hiding this comment.
is this the right place instead of patching parser?
There was a problem hiding this comment.
The parser is the cleaner place for this diagnostic. I used the existing BarrySource adapter to keep the extraction independent of a parser release, but the review uncovered a real weakness: for 2 <<> 3, the textual match overlaps the << token and incorrectly emits the obsolete-comparison hint. I confirmed that with compile-only CPython 3.14.8/native checks. A comparison-context check in the pinned parser is the appropriate fix; the compiler override must also stop replacing that parser diagnostic. I am checking the narrow dependency path rather than importing the broader parser changes. This draft is not ready in its current form.
5b0fac6 to
7b25dc1
Compare
7b25dc1 to
1c36965
Compare
1c36965 to
0596dee
Compare
0596dee to
aa02e48
Compare
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_mmap.py (TODO: 19) dependencies: dependent tests: (2 tests)
Legend:
|
Use the existing Barry adapter token spans for ordinary obsolete-comparison diagnostics as well. Preserve parser errors for left-shift suffixes, malformed comparisons, comments and strings, with final Python 3.15 message and span regressions. Assisted-by: OpenAI Codex:model identifier unavailable
aa02e48 to
dd0c42f
Compare
Current Python 3.15 main target
#8950 is merged. This PR now targets
mainand replays only its unique commits onto06007c81fa99e813cbf4583dab326764ba0ef017. Current head:0596dee73ddc11c12c6c957bcd3b68d8a132a657. The prior bootstrap commits are not part of this PR's diff.Normal commit hooks, whitespace checks, and independent source/patch-equivalence review passed. The intervening main fixes are preserved and this PR introduces no changes under
Lib/. No new local build or runtime validation is claimed for this rebased head. The maintainer-requested[skip ci]marker remains; full CI is intentionally paused pending selective validation.The previously identified parser limitation remains unresolved; this rebase does not fix or hide it.
Prior stack and validation history
The base/head references below describe earlier revisions; the current target and validation limits above supersede them.
Temporary CI pause
The head commit includes
[skip ci]at the maintainer's request. This message-only amendment preserves the exact source tree and commit parents. Normal pull-request CI is intentionally skipped; required checks may remain pending. This does not itself cancel older runs or suppresspull_request_targetworkflows.Python 3.15 stack
Depends on #8950 at
80d3e52f32341d3158c659d82a927373b51b6439. This PR targets the upstreamstack/python-3.15-8950branch at that exact commit, so its displayed diff contains only the leaf changes. Unique changes above #8950.Current head
1c369652c89e651cd125d82e5e25618f4dade037was checked by source/range-diff review, normal commit hooks, and patch checks. Its unique delta changes no files underLib/and inherits the 3.15.0 reference. No new local build or runtime execution is claimed for this stacked head; validation described below applies to the earlier head unless explicitly updated. Exact-head hosted CI is temporarily skipped.The existing parser limitation remains unresolved; this stacking change adds no parser implementation or workaround.
Summary
Extract the compiler-only obsolete
<>diagnostic fix from #8954, matching the Python 3.14.8 backport 66f8dbe0 / CPython #158190.2 <> 3suggests!=and highlights both operator characters.<>stays a generic syntax error and highlights only its first character.The existing registry parser already supplies the required error information. No vendored parser, new parser feature, or Python 3.15 diagnostics are included.
.python-versionis pinned to 3.14.8, consistently with #9063 and the other approved 3.14.8 backports; 3.14.7 intentionally retains the older behavior.Coverage preservation
Move exactly two changed Python-visible expectations from the existing Rust test into
builtin_compile.py: the infix message and bare-operator end position. Their Rust sites retain structuralParsechecks; all four original rejection cases and all other control assertions remain. The Python cases assert exact messages and all four position fields, plus an unrelated-token control and valid Barry-mode evaluation. No canonical assertion is weakened to make the test pass.Validation
test_fluflcases pass.Local Python validation deliberately runs only the exact ASCII diagnostic block, rather than claiming the entire
builtin_compile.pysnippet was executed. The full hosted matrix remains required.