skx / gobasic

A BASIC interpreter written in golang.
https://blog.steve.fi/tags/basic/
GNU General Public License v2.0
328 stars 27 forks source link

Allow omitting GOTO for IF-tests. #83

Closed skx closed 5 years ago

skx commented 5 years ago

This pull-request allows the GOTO token to be omitted for IF-based tests. For example this is now valid:

    IF a < b THEN 300 ELSE 400

We silently rewrite the program at parse-time to be:

    IF a < 3 THEN GOTO 300 ELSE GOTO 400

Which allows us to continue working as before.

This closes #82.