pub trait Executor {
fn new() -> Self;
fn set_global(&mut self, name: String, val: Value) -> Value;
fn get_global(&self, name: String) -> Value;
fn make_scope(&mut self, this: Value) -> Scope;
fn destroy_scope(&mut self) -> Scope;
fn run(&mut self, expr: &Expr) -> ResultValue;
}
Expand description
An execution engine
Required Methods
sourcefn set_global(&mut self, name: String, val: Value) -> Value
fn set_global(&mut self, name: String, val: Value) -> Value
Set a global variable called name
with the value val
sourcefn get_global(&self, name: String) -> Value
fn get_global(&self, name: String) -> Value
Resolve the global variable name
sourcefn make_scope(&mut self, this: Value) -> Scope
fn make_scope(&mut self, this: Value) -> Scope
Create a new scope and return it
sourcefn destroy_scope(&mut self) -> Scope
fn destroy_scope(&mut self) -> Scope
Destroy the current scope
sourcefn run(&mut self, expr: &Expr) -> ResultValue
fn run(&mut self, expr: &Expr) -> ResultValue
Run an expression