diff options
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/scanner.cxx | 43 | ||||
-rw-r--r-- | basic/source/inc/scanner.hxx | 2 |
2 files changed, 25 insertions, 20 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 5d1f36b74e86..2b594de03766 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -161,6 +161,28 @@ inline bool lclIsWhitespace( sal_Unicode cChar ) } // namespace +void SbiScanner::scanGoto() +{ + const sal_Unicode* pTestLine = pLine; + short nTestCol = nCol; + while( lclIsWhitespace( *pTestLine ) ) + { + pTestLine++; + nTestCol++; + } + + if( *pTestLine && *(pTestLine + 1) ) + { + String aTestSym = aLine.copy( nTestCol, 2 ); + if( aTestSym.EqualsIgnoreCaseAscii( "to" ) ) + { + aSym = String::CreateFromAscii( "goto" ); + pLine = pTestLine + 2; + nCol = nTestCol + 2; + } + } +} + bool SbiScanner::NextSym() { // memorize for the EOLN-case @@ -240,26 +262,7 @@ bool SbiScanner::NextSym() // Special handling for "go to" if( bCompatible && *pLine && aSym.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("go") ) ) - { - const sal_Unicode* pTestLine = pLine; - short nTestCol = nCol; - while( lclIsWhitespace( *pTestLine ) ) - { - pTestLine++; - nTestCol++; - } - - if( *pTestLine && *(pTestLine + 1) ) - { - String aTestSym = aLine.copy( nTestCol, 2 ); - if( aTestSym.EqualsIgnoreCaseAscii( "to" ) ) - { - aSym = String::CreateFromAscii( "goto" ); - pLine = pTestLine + 2; - nCol = nTestCol + 2; - } - } - } + scanGoto(); // replace closing '_' by space when end of line is following // (wrong line continuation otherwise) diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx index c96387ebbe3e..e98ebc32c9f3 100644 --- a/basic/source/inc/scanner.hxx +++ b/basic/source/inc/scanner.hxx @@ -45,6 +45,8 @@ class SbiScanner ::rtl::OUString aLine; const sal_Unicode* pLine; const sal_Unicode* pSaveLine; + + void scanGoto(); protected: ::rtl::OUString aSym; String aError; |