Closed cosbgn closed 4 years ago
Never mind, my syntax was wrong. It all works.
Contrived example for future weary google travelers:
const expression = "5 + 2";
const interpreter = new Interpreter(expression);
interpreter.run()
const result = interpreter.value;
By default the library returns the last value, however I would like to return at a specific point, something like this:
This will fail, because the
returns
are not valid, so I tried to wrap them in a function:but also this fails. Any ideas on how this could be done?