diff options
Diffstat (limited to 'basic/source/comp/loops.cxx')
-rw-r--r-- | basic/source/comp/loops.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index b2e7eb7736c4..388911be93c7 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -458,13 +458,21 @@ done: void SbiParser::On() { SbiToken eTok = Peek(); - String aString = SbiTokenizer::Symbol(eTok); - if (aString.EqualsIgnoreCaseAscii("ERROR")) + OUString aString = SbiTokenizer::Symbol(eTok); + if (aString.equalsIgnoreAsciiCase("ERROR")) + { eTok = _ERROR_; // Error comes as SYMBOL - if( eTok != _ERROR_ && eTok != LOCAL ) OnGoto(); + } + if( eTok != _ERROR_ && eTok != LOCAL ) + { + OnGoto(); + } else { - if( eTok == LOCAL ) Next(); + if( eTok == LOCAL ) + { + Next(); + } Next (); // no more TestToken, as there'd be an error otherwise Next(); // get token after error @@ -476,7 +484,9 @@ void SbiParser::On() if( MayBeLabel() ) { if( eCurTok == NUMBER && !nVal ) + { aGen.Gen( _STDERROR ); + } else { sal_uInt32 nOff = pProc->GetLabels().Reference( aSym ); @@ -487,12 +497,18 @@ void SbiParser::On() { Next(); if( eCurTok == NUMBER && nVal == 1 ) + { aGen.Gen( _STDERROR ); + } else + { bError_ = true; + } } if( bError_ ) + { Error( SbERR_LABEL_EXPECTED ); + } } else if( eCurTok == RESUME ) { |