pub fn compile(prog: &Program) -> Result<String> {
    let ctx = make_global_context(prog)?;
    let code = [
        cmp_imports(prog)?,
        cmp_decls(&ctx)?,
        cmp_main_loop(&ctx, prog)?,
        cmp_output(&ctx)?,
    ];
    Ok(code.join("\n"))
}
/// Generates a JavaScript function body that evaluates the program.
Generates a JavaScript function body that evaluates the program.
Generates a JavaScript function body that evaluates the program .
pub fn compile(prog: &Program) -> Result<String> {
    let ctx = make_global_context(prog)?;
    let code = [
        cmp_imports(prog)?,
        cmp_decls(&ctx)?,
        cmp_main_loop(&ctx, prog)?,
        cmp_output(&ctx)?,
    ];
    Ok(code.join("\n"))
}
pub fn compile ( prog : & Program ) -> Result < String > { let ctx = make_global_context ( prog ) ? ; let code = [ cmp_imports ( prog ) ? , cmp_decls ( & ctx ) ? , cmp_main_loop ( & ctx , prog ) ? , cmp_output ( & ctx ) ? , ] ; Ok ( code . join ( " \n " ) ) }
Generates a JavaScript function body that evaluates the program.
Generates a JavaScript function body that evaluates the program .
prog
&Program
prog
&Program