summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-12-04 22:13:24 -0500
committerAugust Sodora <augsod@gmail.com>2011-12-04 22:13:24 -0500
commit40be618fb31754611dbd4241322004b205774976 (patch)
treea0c9195f5d4a746ad08b720439314cd3f475782d /basic
parentf81a7438409ee9cede09b0395d8af0943220a4ea (diff)
Refactor scanAlphanumeric
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx17
-rw-r--r--basic/source/inc/scanner.hxx1
2 files changed, 14 insertions, 4 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index cc17fd5c163d..4b4ba2357536 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -150,6 +150,17 @@ static SbxDataType GetSuffixType( sal_Unicode c )
// return value is sal_False at EOF or errors
#define BUF_SIZE 80
+void SbiScanner::scanAlphanumeric()
+{
+ sal_uInt16 n = nCol;
+ while(theBasicCharClass::get().isAlphaNumeric(*pLine, bCompatible) || *pLine == '_')
+ {
+ pLine++;
+ nCol++;
+ }
+ aSym = aLine.copy(n, nCol - n);
+}
+
void SbiScanner::scanGoto()
{
sal_uInt16 nTestCol = nCol;
@@ -240,10 +251,8 @@ bool SbiScanner::NextSym()
{ pLine++;
goto eoln; }
bSymbol = true;
- sal_uInt16 n = nCol;
- for ( ; (theBasicCharClass::get().isAlphaNumeric( *pLine, bCompatible ) || ( *pLine == '_' ) ); pLine++ )
- nCol++;
- aSym = aLine.copy( n, nCol - n );
+
+ scanAlphanumeric();
// Special handling for "go to"
if( bCompatible && *pLine && aSym.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("go") ) )
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index c254cf2977b3..abda26be4663 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -46,6 +46,7 @@ class SbiScanner
const sal_Unicode* pLine;
const sal_Unicode* pSaveLine;
+ void scanAlphanumeric();
void scanGoto();
protected:
::rtl::OUString aSym;