neilsf / XC-BASIC

A compiling BASIC dialect for the Commodore-64
https://xc-basic.net/
MIT License
74 stars 15 forks source link

EXIT DO in DO loop in FOR loop causes compilation error #147

Closed fredrikr closed 2 years ago

fredrikr commented 2 years ago

This program causes the error in line 9: Unclosed FOR block before LOOP

DIM j AS BYTE
DIM x AS BYTE

FOR j = 1 TO 2
    x = 3
    DO WHILE x > 1
        IF x < 2 THEN EXIT DO
        x = x - 1
    LOOP
NEXT j
neilsf commented 2 years ago

It compiles fine for me. Are you using the latest compiler?

fredrikr commented 2 years ago

Wrong repo. I was reading the XC=BASIC 3 docs and clicked on Issues in the menu, and this is where I ended up.

I have now reported it at https://github.com/neilsf/xc-basic3/issues instead.

neilsf commented 2 years ago

Yeah, wrong link on the website. Fixed that.