mimium_lang::compiler::mirgen

Function compile

Source
pub fn compile(
    root_expr_id: ExprNodeId,
    builtin_types: &[(Symbol, TypeNodeId)],
    file_path: Option<Symbol>,
) -> Result<Mir, Vec<Box<dyn ReportableError>>>
Expand description

Generate MIR from AST. The input ast (root_expr_id) should contain global context. (See [[compiler::parser::add_global_context]].) MIR generator itself does not emit any error, the any compile errors are analyzed before generating MIR, mostly in type checker.