ams-hackers / gbforth

👾 A Forth-based Game Boy development kit
https://gbforth.org
MIT License
121 stars 23 forks source link

Detect unreachable code #327

Closed tkers closed 4 years ago

tkers commented 4 years ago

This detects unreachable IR nodes and shows an error when trying to compile words/literals to it:

test/test-ahead-then.fs:3: Unreachable code:
  ahead >>>3<<< 4 5 6 7 then

Similarly, the final return, (typically compiled by ;) can be skipped in these definitions too.

Fixes #281