mitra42 / webForth

Forth for the web - implemented in JS and other web technologies
https://www.mitra.biz/forth/console.html
GNU Affero General Public License v3.0
27 stars 1 forks source link

Handle Errors in interpret() #19

Closed mitra42 closed 3 years ago

mitra42 commented 3 years ago

interpret is fragile after it switches to use $INTERPRET If it sees something it doesn't understand it does a THROW and has no HANDLER to catch that, this resets the stack to something bizarre

STR interpret('XYZZY') will blow the stack.

mitra42 commented 3 years ago

Note this is really tricky - can't figure out during bootstrap.

mitra42 commented 3 years ago

Its fixed now for anything run after the forthInForth stage using interpret1() (for one line) rather than interpret() so will leave this.