aw / fiveforths

32-bit RISC-V Forth for microcontrollers
https://fiveforths.a1w.ca
MIT License
66 stars 3 forks source link

Handle incomplete word definitions #4

Closed aw closed 1 year ago

aw commented 1 year ago

When defining a new word, if an undefined word is used in the definition, then the interpreter correctly prints a ? but it incorrectly leaves the half-defined word in memory (and HERE remains at the previously added word). I think in this case it should reset HERE to the beginning of the word (assuming it's in compile mode), whose address might be found in LATEST.

The lookup function will need to be modified to jump to a different error handler.