pub trait Parser: Debug {
fn parse(&self, input: &str, heap: &mut Heap) -> EvalResult<Program>;
fn eval_func(&self) -> HostFn;
fn load(&mut self, heap: &mut Heap) -> EvalResult<()> { ... }
}
Expand description
Describes anything that can parse JS code.
Required Methods
Parses an input into a Program
(potentially using the heap
)
Provided Methods
fn load(&mut self, heap: &mut Heap) -> EvalResult<()>
fn load(&mut self, heap: &mut Heap) -> EvalResult<()>
Called by Runtime::load
to initialize the parser.
If the parser does not need to touch Heap
, do nothing.