SamCoVT / TaliForth2

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

Enforces error on name length > 31; also simplifies ENVIRONMENT? and saves some string bytes #112

Closed patricksurry closed 2 days ago

patricksurry commented 1 month ago

The main change is to complain on names longer than 31 chars (feel free to suggest a better error message).

I also switched the error string encoding to hi-bit terminated instead of null terminated to save some bytes. Another option if you don't like the hi-bit .shift thing would be to use the difference in pointers between adjacent string table entries like I did as part of simplifying/shortening environment?.

After the changes the net image size is 26 bytes smaller.

I tested manually like this:

Tali Forth 2 comes with absolutely NO WARRANTY
Type 'bye' to exit
: supercalifragilisticexpialidocious 3 + ; Name too long (max 31)

Is there a good way to do something like that in a unit test?