pub struct Program {
pub files: Arena<SourceFile>,
pub settings: Option<Settings>,
pub global_variables: Arena<WorkshopVariable>,
pub player_variables: Arena<WorkshopVariable>,
pub subroutines: Arena<WorkshopSubroutine>,
pub rules: Arena<Rule>,
pub values: Arena<ValueNode>,
pub actions: Arena<Action>,
}Expand description
The Workshop IR program: tables and arenas produced by lowering.
Fields§
§files: Arena<SourceFile>The source-file registry, copied from the source HIR so spans remain resolvable for diagnostics.
settings: Option<Settings>The custom-game-settings carrier, copied inertly from the source HIR (emitted verbatim, never lowered, #86).
global_variables: Arena<WorkshopVariable>§player_variables: Arena<WorkshopVariable>§subroutines: Arena<WorkshopSubroutine>§rules: Arena<Rule>§values: Arena<ValueNode>§actions: Arena<Action>Implementations§
Source§impl Program
impl Program
Sourcepub fn element_count(
&self,
catalog: &Catalog,
) -> Result<ElementCountReport, ElementCountError>
pub fn element_count( &self, catalog: &Catalog, ) -> Result<ElementCountReport, ElementCountError>
Count the canonical Workshop target represented by this WIR program.
The catalog is used to reject unknown action/value identities before a report is produced. Native display actions are represented by their canonical catalog-backed action calls.
Source§impl Program
impl Program
Sourcepub fn validate(&self) -> Result<(), IrError>
pub fn validate(&self) -> Result<(), IrError>
Validate structural invariants: every ID resolves and every span is
valid. Returns the first violation as a structured IrError.
Sourcepub fn semantic_issues(&self, catalog: &Catalog) -> Vec<SemanticIssue>
pub fn semantic_issues(&self, catalog: &Catalog) -> Vec<SemanticIssue>
Report preserved or unknown constructs separately from structural validation so consumers cannot present analysis as definitive.