1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 07:10:22 +00:00

Fixes TAB before ELSE bug for the IDE.

This commit is contained in:
FellippeHeitor 2018-09-18 01:03:55 -03:00
parent 7068ce029e
commit fcf68e093b

View file

@ -2788,6 +2788,7 @@ DO
'2. Feed next line '2. Feed next line
IF EOF(fh) = 0 THEN IF EOF(fh) = 0 THEN
LINE INPUT #fh, x$ LINE INPUT #fh, x$
wholeline$ = x$ wholeline$ = x$
inclinenumber(inclevel) = inclinenumber(inclevel) + 1 inclinenumber(inclevel) = inclinenumber(inclevel) + 1
'create extended error string 'incerror$' 'create extended error string 'incerror$'
@ -5792,11 +5793,11 @@ DO
'END IF 'END IF
'Notice the ELSE with the SELECT CASE? Before this patch, commands like those were considered valid QB64 code. 'Notice the ELSE with the SELECT CASE? Before this patch, commands like those were considered valid QB64 code.
temp$ = UCASE$(LTRIM$(RTRIM$(wholeline))) temp$ = UCASE$(LTRIM$(RTRIM$(wholeline)))
IF NoIDEMode THEN 'IF NoIDEMode THEN
DO WHILE INSTR(temp$, CHR$(9)) DO WHILE INSTR(temp$, CHR$(9))
ASC(temp$, INSTR(temp$, CHR$(9))) = 32 ASC(temp$, INSTR(temp$, CHR$(9))) = 32
LOOP LOOP
END IF 'END IF
goodelse = 0 'a check to see if it's a good else goodelse = 0 'a check to see if it's a good else
IF LEFT$(temp$, 2) = "IF" THEN goodelse = -1: GOTO skipelsecheck 'If we have an IF, the else is probably good IF LEFT$(temp$, 2) = "IF" THEN goodelse = -1: GOTO skipelsecheck 'If we have an IF, the else is probably good
IF LEFT$(temp$, 4) = "ELSE" THEN goodelse = -1: GOTO skipelsecheck 'If it's an else by itself,then we'll call it good too at this point and let the rest of the syntax checking check for us IF LEFT$(temp$, 4) = "ELSE" THEN goodelse = -1: GOTO skipelsecheck 'If it's an else by itself,then we'll call it good too at this point and let the rest of the syntax checking check for us