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

It is impossible to avoid infinite loops #116

Closed skx closed 2 years ago

skx commented 2 years ago

Consider the following input:

10 GOTO 10

That program will never terminate, and an application which embeds this interpreter cannot catch it either.

Add a SetContext method, or NewWithContext, to allow handling this.