skx / gobasic

A BASIC interpreter written in golang.

Home Page:https://blog.steve.fi/tags/basic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better error-handling.

skx opened this issue · comments

Since LET is currently optional (I might reconsider, and #80 does make a good case) this should show an error:

10 A = 3

It does not:

 frodo ~ $ cat t.bas 
 10 A = 3

 frodo ~ $ gobasic t.bas 
 frodo ~ $

 frodo ~ $ gobasic -trace=true t.bas 
 RunOnce( Token{Type:LINENO Value:10} )
 RunOnce( Token{Type:IDENT Value:A} )
 RunOnce( Token{Type:INT Value:3} )

Here it is calling RunOnce with an IDENT token - which then gets evaluated via the default branch and results in no-error (which is a surprise).

Reported as it happened, indirectly in #85.