Files
RustPython/crates/codegen
youknowdot 1ee9a29062 Preserve explicit AST source positions through compilation (#9138)
* Preserve explicit AST column locations through code generation

Assisted-by: OpenAI Codex:model version unavailable

* Remove obsolete location bindings after span migration

Assisted-by: OpenAI Codex:model version unavailable

* Propagate inconsistent AST span provenance without panicking

Assisted-by: OpenAI Codex:model version unavailable

* Preserve mapped positions when exporting optimized Pass nodes

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate AST location regressions and satisfy strict compiler lints

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate equivalent AST literal location cases

Replace the six-way literal-only optimizer matrix with one optimized-AST round-trip, preserving all assertions. Keep the distinct normalized-range identity, explicit Pass provenance, and synthetic format-spec regressions.

Validation: all four appended location cases passed using the verified final-f6a RustPython binary with unchanged native sources. Ran normal pre-commit hooks; no Cargo build or full cyclic snippet suite.

Assisted-by: OpenAI Codex:model version unavailable

* Reuse Ruff source locations in AST conversion

Replace redundant PySourceLocation, Row, and Column wrappers with the compiler-core re-export of Ruff SourceLocation. Use UTF-8 byte coordinates and retain the empty-source fallback. Share the normalized range conversion while preserving caller validation and signed semantic metadata.

Validation so far: independent source and boundary review, rustfmt, and git diff --check. Runtime validation follows after the shared build target is released.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the first AST preprocessing location error

Share first-error recording between generated-node allocation and synthetic-pass coordinate overflow. Exercise both real compiler-state failure paths in both orders using one MAX_ID location entry.

Validation: focused compiler-state regression, strict codegen all-target Clippy, unchanged full-source seals, rustfmt, and normal pre-commit hooks. No interpreter runtime or broad suite rerun for this error-only change.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 10:13:59 +09:00
..
2026-07-07 09:19:25 +09:00