Skip to main content

compile

Function compile 

Source
pub fn compile<'a>(
    source: &str,
    arena: &'a Arena,
) -> Result<(Ir, StratifiedProgram<'a>)>
Expand description

Compiles source code into the Mangle Intermediate Representation (IR).

This function performs:

  1. Parsing of the source string into an AST.
  2. Renaming: Applies package rewrites to support module namespacing.
  3. Stratification: Orders the evaluation of rules.
  4. Lowering: Converts the AST into the flat IR.

Returns a tuple containing the IR and the stratification info (which dictates the order of execution).