summaryrefslogtreecommitdiff
path: root/basic/source/comp
diff options
context:
space:
mode:
authorDamjan Jovanovic <damjan@apache.org>2015-11-24 18:56:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-25 20:46:26 +0000
commitd5443023effb6231496f1231026bcd040d311408 (patch)
tree908d34f657f53cb5fd77c192e658ab5db751f8f9 /basic/source/comp
parentdb884459a0e250122f8bbcc906107ce424f1e955 (diff)
#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 f8a51d0f5a645704bc2bdc939474ac931d55559c)
Diffstat (limited to 'basic/source/comp')
-rw-r--r--basic/source/comp/token.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 03f1a5ac2fbd..8fb0aac121a5 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -433,7 +433,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;