SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
29 stars 7 forks source link

Undefined Word error message has missing letters sometimes #14

Closed SamCoVT closed 1 year ago

SamCoVT commented 1 year ago

When Tali encounters an unknown word, it tries to call NUMBER on it to convert it to a number (this is standard Forth behavior). The issue is that if the word begins with numbers (in the case of BASE being HEX, if it starts with a-f), the "numerical" portion of the word has already been processed and the error prints only what is left in the error message, as shown in this example:

hex  ok
absolutely >solutely< Undefined word

The proposed solution is to keep a copy of the original "addr u" that can be recalled and used to print the unknown word if an error is encountered (or discarded if no errors are encountered).