Function portus::lang::compile [−][src]
pub fn compile(src: &[u8], updates: &[(&str, u32)]) -> Result<(Bin, Scope)>
compile()
uses 5 passes to yield Instrs.
Expr::new()
(called byProg::new_with_scope()
internally) returns a single AST fromsrc
Prog::new_with_scope()
returns a list of ASTs for multiple expressions- The ASTs are desugared to support (report) and (fallthrough).
- The list of runtime updates (from
updates
) for values is applied to the Scope. Bin::compile_prog()
turns aProg
into aBin
, which is aVec
of datapathInstr