Kaydet (Commit) 40be618f authored tarafından August Sodora's avatar August Sodora

Refactor scanAlphanumeric

üst f81a7438
...@@ -150,6 +150,17 @@ static SbxDataType GetSuffixType( sal_Unicode c ) ...@@ -150,6 +150,17 @@ static SbxDataType GetSuffixType( sal_Unicode c )
// return value is sal_False at EOF or errors // return value is sal_False at EOF or errors
#define BUF_SIZE 80 #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() void SbiScanner::scanGoto()
{ {
sal_uInt16 nTestCol = nCol; sal_uInt16 nTestCol = nCol;
...@@ -240,10 +251,8 @@ bool SbiScanner::NextSym() ...@@ -240,10 +251,8 @@ bool SbiScanner::NextSym()
{ pLine++; { pLine++;
goto eoln; } goto eoln; }
bSymbol = true; bSymbol = true;
sal_uInt16 n = nCol;
for ( ; (theBasicCharClass::get().isAlphaNumeric( *pLine, bCompatible ) || ( *pLine == '_' ) ); pLine++ ) scanAlphanumeric();
nCol++;
aSym = aLine.copy( n, nCol - n );
// Special handling for "go to" // Special handling for "go to"
if( bCompatible && *pLine && aSym.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("go") ) ) if( bCompatible && *pLine && aSym.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("go") ) )
......
...@@ -46,6 +46,7 @@ class SbiScanner ...@@ -46,6 +46,7 @@ class SbiScanner
const sal_Unicode* pLine; const sal_Unicode* pLine;
const sal_Unicode* pSaveLine; const sal_Unicode* pSaveLine;
void scanAlphanumeric();
void scanGoto(); void scanGoto();
protected: protected:
::rtl::OUString aSym; ::rtl::OUString aSym;
......
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