Skip to main content

exec_script

Function exec_script 

Source
pub fn exec_script(
    stmts: &[StmtEntry],
    env: &mut Env,
    io: &mut IoContext,
    fmt: &FormatMode,
    base: Base,
    compact: bool,
) -> Result<Option<Signal>, String>
Expand description

Execute a top-level script block (REPL input, pipe/script mode, eval()).

Identical to exec_stmts but first calls hoist_functions so that helper functions defined at the bottom of the script are visible to code above them — matching MATLAB/Octave script semantics.