BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
7 stars 6 forks source link

single line IF statement with ELSE and potentially FI / ENDIF flagged as error #149

Open StephanWald opened 1 month ago

StephanWald commented 1 month ago
value! = ""
c=9
html! = ""
html=0 

if value! = null() then value$ = "null" else value$ = String.valueOf(value!)

if c<128 then html!.append(chr(c)) else html!.append("&#").append(str(c)).append(";"); _html=1

IF A=6 THEN B=7 ELSE X=6 FI; PRINT X; IF x=7 THEN A=f; PRINT X

IF A=6 THEN B=7 ELSE X=6 FI; PRINT X

IF x=7 THEN A=f; PRINT X
StephanWald commented 6 days ago

More samples:

if touch then title$ = title$ + " (Touch)" else title$ = title$ + " (Not Touch)"

if web then body$ = "" else body$ = "document.body."

index = 0; if index!<>null() then index = num(index!)

if result! = null() then result$ = "null" else result$ = result!.getClass().getName()+" "+result!.toString()
StephanWald commented 6 days ago

@dhuebner can we tackle this one soon please? It's one of the last egregious issues that flags tons of sample programs

StephanWald commented 6 days ago

also a problem:

top_rs_row = rs_row; if debug then ? "top_rs_row=",top_rs_row