Skip to main content

lower_code

Function lower_code 

Source
pub fn lower_code<I, C>(
    code: Vec<I>,
    symbols: &[Symbol],
    context: &mut C,
) -> Result<Vec<I::Runtime>>
where I: Lower<C>,
Expand description

Lower a code stream in address order.

Each syntax instruction lowers to one runtime instruction. The context must already know the whole symbol table, so forward references resolve. Errors name the instruction by address and nearest preceding symbol; no partial code vector is returned. Context mutations before an error are not rolled back.