Skip to main content

exec_stmts

Function exec_stmts 

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

Executes a sequence of parsed statements, handling flow control signals.

Returns:

  • Ok(None) — normal completion
  • Ok(Some(Signal::Break))break statement executed
  • Ok(Some(Signal::Continue))continue statement executed
  • Err(e) — runtime error

Loop implementations (For, While) catch Break/Continue internally. A signal that escapes to the top-level caller should be reported as an error.