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)

Get the native callback for eval() in JavaScript provided by this parser

Provided Methods

Called by Runtime::load to initialize the parser.

If the parser does not need to touch Heap, do nothing.

Implementors