Strange syntax error

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
OldHacker
Posts: 2
Joined: Thu 02 Aug 2018, 16:52

Strange syntax error

Post by OldHacker »

Dear BBC Basic

I have used BBC Basic since the early days of the BBC MICRO.
I currently use my purchased version BBC Basic Windows 6.12 under Windows 10
I therefore thought it would be interesting to try the Linux version (linuuux mint 20 Cinnamon)
SDL 2.0 for Linux systems. Unfortunately I encounter a syntax error
in the statement

ON IP PROC_1,PROC_2 ELSE PROC_3

My test program is

10 REM Test of ON
20 IP = 2
30 PRINT "IP = ",IP
40 ON IP PROC_1,PROC_2 ELSE PROC_3
50 REM IF IP=1 THEN PROC_1 ELSE PROC_2
100 END
110
120 DEF PROC_1
130 PRINT "Proc 1"
140 ENDPROC
150
160 DEF PROC_2
170 PRINT "Proc 2"
180 ENDPROC
190
DEF PROC_3
PRINT"Proc3"
ENDPROC
200 END
210
220

which produces the output:
IP= 2
Syntax error at line 40

whereas under the Windows 6.12a it correctly produces
IP= 2
Proc 2

Please advise.

RichardRussell
Posts: 525
Joined: Tue 15 Oct 2019, 09:10

Re: Strange syntax error

Post by RichardRussell »

OldHacker wrote:
Wed 30 Sep 2020, 15:24
Please advise.
I agree it looks like a bug. I don't think I've ever used ON ... PROC in any of my programs which may explain how it has been missed, although I'm surprised it wasn't picked up in the test suite I run after any change. That could mean the test suite itself needs to be checked for coverage.

I'll post again once I know more, thanks for the report.
If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.

RichardRussell
Posts: 525
Joined: Tue 15 Oct 2019, 09:10

Re: Strange syntax error

Post by RichardRussell »

RichardRussell wrote:
Wed 30 Sep 2020, 16:14
I agree it looks like a bug.
Yes, definitely a bug (the 32-bit Linux edition isn't affected, but the 64-bit one is), and although it should have been picked up in the test suite, that particular test had been bypassed sometime in the past, for some inexplicable reason. :?

I'll release a fixed version tomorrow, all being well, but there are now so many different editions to build and upload it's not a quick process. :(
If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.

OldHacker
Posts: 2
Joined: Thu 02 Aug 2018, 16:52

Re: Strange syntax error

Post by OldHacker »

Thank you Richard