Reorganize using workspaces

This commit is contained in:
Andrew Morris
2023-02-27 12:35:37 +11:00
parent aafe1c1168
commit 44759d16a8
59 changed files with 515 additions and 412 deletions

View File

@@ -0,0 +1,23 @@
use super::vs_value::Val;
pub type StackFrame = Box<dyn StackFrameTrait>;
#[derive(Clone)]
pub struct CallResult {
pub return_: Val,
pub this: Val,
}
pub enum FrameStepResult {
Continue,
Pop(CallResult),
Push(StackFrame),
}
pub trait StackFrameTrait {
fn write_this(&mut self, this: Val);
fn write_param(&mut self, param: Val);
fn step(&mut self) -> FrameStepResult;
fn apply_call_result(&mut self, call_result: CallResult);
fn get_call_result(&mut self) -> CallResult;
}