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:
- Parsing of the source string into an AST.
- Renaming: Applies package rewrites to support module namespacing.
- Stratification: Orders the evaluation of rules.
- Lowering: Converts the AST into the flat IR.
Returns a tuple containing the IR and the stratification info (which dictates the order of execution).