Kaydet (Commit) f8a51d0f authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic

#i117960# Basic: Line Input doesn't work in single-line If

i92642 added the ability to use certain keywords as variable names (eg. name = 1, line = "hi"),
but also caused a regression where "Line Input" is broken in single-line If statements.
This patch fixes that by allowing Then and Else to also be the start-of-line tokens expected to
immediately preceed the "Line" token in order for that "Line" token to be recognized a keyword instead
of a variable name. Also added FVT spreadsheet tests for "Line" as both a variable name and as "Line Input".

Patch by: me
üst 84dc0bfe
......@@ -557,7 +557,8 @@ SbiToken SbiTokenizer::Next()
}
special:
// #i92642
bool bStartOfLine = (eCurTok == NIL || eCurTok == REM || eCurTok == EOLN);
bool bStartOfLine = (eCurTok == NIL || eCurTok == REM || eCurTok == EOLN ||
eCurTok == THEN || eCurTok == ELSE); // single line If
if( !bStartOfLine && (tp->t == NAME || tp->t == LINE) )
return eCurTok = SYMBOL;
else if( tp->t == TEXT )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment