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

Unterminated FOR-loops should be an error. #37

Closed skx closed 6 years ago

skx commented 6 years ago

This program produces no error, but I think it should:

10 FOR I = 1 TO 10
20  PRINT I, "\n"
skx commented 6 years ago

I made a change to handle this, but then all the tests started to fail.

It took me a while to realize the cause - the FOR loop-structure is global which means different runs of the engine used the same records. Oops.

This means this issue will need to be closed at the same time as #36 - because the solution to that is to:

D'oh.