mech_interpreter/
frame.rs

1use crate::*;
2
3#[derive(Clone, PartialEq, Eq, Debug)]
4pub enum FrameState {
5  Running,
6  Suspended,
7  Completed,
8}
9
10#[derive(Clone)]
11pub struct Frame {
12  plan: Plan,
13  ip: usize,               // next instruction
14  locals: SymbolTableRef,  // for subroutine variables
15  out: Option<Value>,      // optional coroutine return
16  state: FrameState,       // Running, Suspended, Completed
17}
18
19#[derive(Clone)]
20pub struct Stack {
21  frames: Vec<Frame>,
22}