Skip to content

Lower OPY program structure into canonical Workshop WIR #40

Description

@Teakowa

Parent: #36
Depends on: #35

Goal

Complete the structural HIR→WIR mapping for the OPY program skeleton without expanding into the full statement/expression compatibility surface.

Scope

  • Lower global/player variable declarations with reference-compatible index allocation and preserved source/name spans.
  • Lower subroutine declarations and definitions into canonical workshop-rs subroutine/rule structures.
  • Lower rules, disabled state, event identity/filter structure, conditions container, and source presentation metadata that belongs on canonical WIR nodes.
  • Preserve OPY source-file/span provenance through every structural node and diagnostic.
  • Use existing workshop-rs WIR/validation contracts directly; do not add another Workshop IR.
  • Keep unsupported event/filter/annotation forms explicit as structured integration diagnostics.

Non-goals

  • Full statement/expression lowering.
  • Catalog-backed builtin/member/enum closure.
  • Settings, locale, optimizer directives, post-compile hooks, or decompilation.

Acceptance criteria

  • Declared variables/subroutines/rules map to structurally valid canonical WIR with deterministic allocation.
  • Source/name spans remain usable after HIR→WIR conversion.
  • Supported event structures validate; unsupported forms fail explicitly.
  • opy-frontend remains Workshop-independent.
  • Focused positive/negative integration fixtures and workspace CI are green.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions