29#include <rtl/character.hxx>
55 , bVBASupportOn(false)
56 , bPrevLineExtentsComment(false)
57 , bClosingUnderscore(false)
58 , bLineEndsWithWhitespace(false)
164 if(
n + 1 <
aLine.getLength())
166 std::u16string_view aTemp =
aLine.subView(
n, 2);
182 sal_Int32 nLen =
aBuf.getLength();
184 while(
n < nLen &&
aBuf[
n] !=
'\r' &&
aBuf[
n] !=
'\n')
197 if(
n + 1 < nLen &&
aBuf[
n] ==
'\r' &&
aBuf[
n + 1] ==
'\n')
215 sal_Int32 nOldLine =
nLine;
216 sal_Int32 nOldCol1 =
nCol1;
217 sal_Int32 nOldCol2 =
nCol2;
223 bool bCompilerDirective =
false;
232 nOldCol1 = nOldCol2 = 0;
235 const sal_Int32 nLineIdxScanStart =
nLineIdx;
254 goto PrevLineCommentLbl;
263 &&
aLine[nLineTempIdx] !=
'#' &&
aLine[nLineTempIdx] !=
',');
265 if (nLineTempIdx >=
aLine.getLength() ||
aLine[nLineTempIdx] !=
'#')
271 bCompilerDirective =
true;
327 bool bScanError =
false;
328 bool bBufOverflow =
false;
330 while(!bScanError &&
nCol <
aLine.getLength() && strchr(
"0123456789.DEde",
aLine[
nCol]))
388 rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
390 nVal = rtl_math_uStringToDouble( buf, buf+(
p-buf),
'.',
',', &eStatus, &pParseEnd );
391 if (pParseEnd != buf+(
p-buf))
394 sal_Int32 nChars = buf+(
p-buf) - pParseEnd;
406 else if (eStatus != rtl_math_ConversionStatus_Ok)
452 switch( rtl::toAsciiUpperCase( xch ) )
469 bool bOverflow =
false;
474 if( ((
base == 16 ) && rtl::isAsciiHexDigit(
ch ) ) ||
475 ((
base == 8) && rtl::isAsciiOctalDigit(
ch )))
479 lu = ( lu *
base ) +
i;
513 nVal =
static_cast<double>(
static_cast<sal_Int16
>(lu) );
519 case SbxLONG:
nVal =
static_cast<double>(
static_cast<sal_Int32
>(lu) );
break;
525 sal_Int32 ls = (lu >
SbxMAXINT && lu <= SbxMAXUINT) ? static_cast<sal_Int16>(lu) :
static_cast<sal_Int32
>(lu);
527 nVal =
static_cast<double>(ls);
531 nVal =
static_cast<double>(lu);
547 sal_Int32
n =
nCol + 1;
567 OUStringBuffer aSymBuf(
aSym.getLength());
568 for ( sal_Int32
i = 0, len =
aSym.getLength();
i < len; ++
i )
570 aSymBuf.append(
aSym[
i] );
571 if (
aSym[
i] == cSep && (
i+1 < len ) &&
aSym[
i+1] == cSep )
574 aSym = aSymBuf.makeStringAndClear();
591 sal_Int32
n =
nCol + 1;
604 std::shared_ptr<SvNumberFormatter> pFormatter;
619 if( !(nType_ & SvNumFormatType::DATE) )
664 ( bCompilerDirective ||
665 aSym.startsWith(
"'") ||
666 aSym.equalsIgnoreAsciiCase(
"REM" ) ) ) )
693 if(
aSym.startsWith(
".") )
static std::shared_ptr< SvNumberFormatter > PrepareNumberFormatter(sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx, LanguageType const *peFormatterLangType=nullptr, DateOrder const *peFormatterDateOrder=nullptr)
std::shared_ptr< SvNumberFormatter > const & GetNumberFormatter()
SbiScanner(OUString, StarBASIC *=nullptr)
bool bPrevLineExtentsComment
bool bLineEndsWithWhitespace
bool CError(ErrCode, const OUString &, sal_Int32, sal_Int32, sal_Int32)
#define LANGUAGE_ENGLISH_US
bool isAlpha(sal_Unicode c, bool bCompatible)
bool isWhitespace(sal_Unicode c)
bool isAlphaNumeric(sal_Unicode c, bool bCompatible)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
#define ERRCODE_BASIC_EXPECTED
#define ERRCODE_BASIC_PROG_TOO_LARGE
#define ERRCODE_BASIC_BAD_CHAR_IN_NUMBER
#define ERRCODE_BASIC_UNEXPECTED
#define ERRCODE_BASIC_LABEL_EXPECTED
#define ERRCODE_BASIC_MATH_OVERFLOW
#define ERRCODE_BASIC_SYMBOL_EXPECTED
#define ERRCODE_BASIC_SYNTAX
#define ERRCODE_BASIC_CONVERSION
#define ERRCODE_BASIC_NO_MEMORY
constexpr sal_Int32 SbxMINLNG
constexpr sal_uInt16 SbxMAXUINT
static SbxDataType GetSuffixType(sal_Unicode c)