Closed nippur72 closed 1 year ago
Tempting...isn't it? I was about to do something like this a few times, but I always decided against it. I decided to keep the frontend language consistent and limited to BASIC V2 instead and to work on the backend. Mainly because I actually don't think that we need another BASIC dialect for the C64 and VIC20 that's incompatible to all the existing ones. But I'll leave this issue open as a reminder...
Instead of inventing yet another BASIC dialect maybe (partial) support for CBM BASIC 3.5 (and 7) would be a nice idea. At least the easily portable stuff to the current targets and adding C16/116/Plus 4 and C128 as targets.
MoSpeed already accepts labels in place of line numbers, why not extend the syntax making it recognize structured loops? It would be great to write structured BASIC and then compile down to machine language.
Just these would be enough:
if
then
else
do
...loop while condition
/do
...loop until condition
while condition
...wend
continue
exit for
,exit do
,exit while
They can all be traslated easily into BASIC v2 statements, they are just IFs and GOTOs. The only problem is in the IF-THEN-ELSE because you have to consider the dangling else problem in your grammar.