EgonOlsen71 / basicv2

A Commodore (CBM) BASIC V2 interpreter/compiler written in Java
https://egonolsen71.github.io/basicv2/
The Unlicense
84 stars 15 forks source link

Add linenumer if there is a SYNTAX ERROR #64

Closed viteisele closed 8 months ago

viteisele commented 8 months ago

When a colon is missing in a program, e. g.

... 400 t9=t9+2 if t9<=n goto 360 ...

There is following output when compiling it:

Loading source file... Checking source file...

!!! Error compiling BASIC program: Syntax error: 2IFT9

With this error message it is hard to find the error in the program, because there is no linenumber. Also the text editor finds no "2IFT9"

Please add the linenumber to the error message.

EgonOlsen71 commented 8 months ago

In the command line version or in the web version? Because at least the command line version prints out the line number like so:

Compiling test.bas... Loading source file... Checking source file... ERROR IN LINE 400: SYNTAX ERROR: 2IFT9

!!! Error compiling BASIC program: Syntax error: 2IFT9

viteisele commented 8 months ago

I used the web version

EgonOlsen71 commented 8 months ago

I see. The web version seems to swallow this information. I'll have a look...

EgonOlsen71 commented 8 months ago

Should be fixed now.

viteisele commented 8 months ago

I can also see the linenumber. Thank you :-)