Kaydet (Commit) d5443023 authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic Kaydeden (comit) Caolán McNamara

#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

(cherry picked from commit f8a51d0f)
üst db884459
...@@ -433,7 +433,8 @@ SbiToken SbiTokenizer::Next() ...@@ -433,7 +433,8 @@ SbiToken SbiTokenizer::Next()
} }
special: special:
// #i92642 // #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) ) if( !bStartOfLine && (tp->t == NAME || tp->t == LINE) )
{ {
return eCurTok = SYMBOL; return eCurTok = SYMBOL;
......
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