feat(opy): complete final #88 source convergence - #156
Conversation
Allow expression newlines within delimiter groups while preserving statement boundaries outside groups. Add HIR/span and invalid-form coverage, and refresh corpus expectations after the syntax residuals advance to owner-specific builtin gaps. Fixes #141
Complete the #141 multiline expression, return, and continue grammar surface with HIR round-trip and canonical loop lowering. Complete the newly exposed #144 builtin, member, enum, alias, and catalog-backed lowering surface with pinned probes and full-corpus evidence. Closes #141 Closes #144 Closes #88
Teakowa
left a comment
There was a problem hiding this comment.
Major — crates/opy-rs/src/lower.rs (context_player_expr)
localPlayer is collapsed to HirExpr::EventPlayer, which the compiler emits as canonical Value::EventPlayer. The pinned Workshop catalog has a distinct localPlayer value, and the pinned Parabola project uses it inside reevaluated expressions where that distinction is observable. Preserve the distinct canonical localPlayer identity through HIR/WIR and add semantic regression coverage for it.
Major — crates/opy-rs/src/compiler/mod.rs (lower_loop_body)
continue lowering only recognizes a top-level continue or an if whose sole branch body is exactly [continue]. Other valid loop-nested shapes fall through lower_action(If) -> lower_actions -> the unsupported Stmt::Continue path, while pinned OverPy resolves continue by walking to the innermost enclosing loop. Make continue lowering work for arbitrary valid loop-nested control flow with nearest-loop semantics, and cover a nested shape beyond the single-action if case.
Major — compatibility/compiler-expectations.json
The newly successful real-world entries remain classification: "known-gap" with semanticEquivalent: false and owner: "opy-rs#88", while this PR closes #88. This violates the file's own evidence policy that known gaps require a concrete follow-up owner and leaves those semantic-WIR differences ownerless after merge. Either demonstrate/classify them as accepted non-semantic or out-of-target differences with the required evidence, or assign an open concrete owner before closing #88.
Preserve localPlayer as its catalog-backed canonical value identity and lower continues through nested loop control flow with nearest-loop semantics. Move residual compiler expectation ownership off the closing #88 issue to open opy-rs#1 while retaining pinned evidence and explicit gap classifications.
Teakowa
left a comment
There was a problem hiding this comment.
Major — crates/opy-rs/src/compiler/mod.rs (lower_loop_sequence)
The nested-continue fix still computes a wrong skip distance when the containing if has later elif/else branches. The branch-local distance adds the enclosing End and the outer loop tail, but not the sibling branch headers/bodies that Workshop emission places before that End. A continue in an earlier branch can therefore land before the loop tail instead of at the nearest-loop continuation point. Include the full emitted conditional remainder in the jump distance (or an equivalent nearest-loop target), and cover an if/else or if/elif continue case.
Major — compatibility/compiler-expectations.json
Changing residual owners from closing #88 to #1 does not satisfy the file's concrete follow-up owner contract. #1 is the broad parent engine goal and its planning section routes source-language completion to #88; it is not an executable owner for these individual semantic-WIR/compiler gaps. Assign an open concrete follow-up issue (a coherent category issue is fine), or classify the differences as accepted non-semantic/out-of-target with the required evidence before closing #88.
Include later conditional branches and structural terminators in nearest-loop skip distances, with an if/else regression. Assign the remaining #88 expectation residuals to open opy-rs#157.
Summary
return, and loopcontinuelowering with HIR round-trip and source-span coverage.Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features— 285opy-rsunit tests plus all CLI/integration targets passed.python3 -m unittest discover -s compatibility/tests— 28 passed.python3 crates/opy-rs/src/manifest/probes/validate.py— 43/43 pinned probes match.The remaining accepted differences are existing compiler/WIR, preprocessing, or explicitly unsupported control-flow boundaries, all retained with provenance and ownership in the expectation tables; no unowned #141/#144 OPY source capability remains.
Closes #141
Closes #144
Closes #88