|
|
@ -22,6 +22,7 @@ namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mStrictKeywords = false;
|
|
|
|
mStrictKeywords = false;
|
|
|
|
mTolerantNames = false;
|
|
|
|
mTolerantNames = false;
|
|
|
|
|
|
|
|
mExpectName = false;
|
|
|
|
mLoc.mColumn = 0;
|
|
|
|
mLoc.mColumn = 0;
|
|
|
|
++mLoc.mLine;
|
|
|
|
++mLoc.mLine;
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
@ -416,12 +417,13 @@ namespace Compiler
|
|
|
|
special = S_close;
|
|
|
|
special = S_close;
|
|
|
|
else if (c=='.')
|
|
|
|
else if (c=='.')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
MultiChar next;
|
|
|
|
// check, if this starts a float literal
|
|
|
|
// check, if this starts a float literal
|
|
|
|
if (get (c))
|
|
|
|
if (get (next))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
putback (c);
|
|
|
|
putback (next);
|
|
|
|
|
|
|
|
|
|
|
|
if (c.isDigit())
|
|
|
|
if (next.isDigit())
|
|
|
|
return scanFloat ("", parser, cont);
|
|
|
|
return scanFloat ("", parser, cont);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -476,13 +478,14 @@ namespace Compiler
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (c.isMinusSign())
|
|
|
|
else if (c.isMinusSign())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (get (c))
|
|
|
|
MultiChar next;
|
|
|
|
|
|
|
|
if (get (next))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (c=='>')
|
|
|
|
if (next=='>')
|
|
|
|
special = S_ref;
|
|
|
|
special = S_ref;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
putback (c);
|
|
|
|
putback (next);
|
|
|
|
special = S_minus;
|
|
|
|
special = S_minus;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -558,6 +561,15 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
|
|
if (special==S_newline)
|
|
|
|
if (special==S_newline)
|
|
|
|
mLoc.mLiteral = "<newline>";
|
|
|
|
mLoc.mLiteral = "<newline>";
|
|
|
|
|
|
|
|
else if (mExpectName && (special == S_member || special == S_minus))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mExpectName = false;
|
|
|
|
|
|
|
|
bool tolerant = mTolerantNames;
|
|
|
|
|
|
|
|
mTolerantNames = true;
|
|
|
|
|
|
|
|
bool out = scanName(c, parser, cont);
|
|
|
|
|
|
|
|
mTolerantNames = tolerant;
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TokenLoc loc (mLoc);
|
|
|
|
TokenLoc loc (mLoc);
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
@ -590,13 +602,14 @@ namespace Compiler
|
|
|
|
const Extensions *extensions)
|
|
|
|
const Extensions *extensions)
|
|
|
|
: mErrorHandler (errorHandler), mStream (inputStream), mExtensions (extensions),
|
|
|
|
: mErrorHandler (errorHandler), mStream (inputStream), mExtensions (extensions),
|
|
|
|
mPutback (Putback_None), mPutbackCode(0), mPutbackInteger(0), mPutbackFloat(0),
|
|
|
|
mPutback (Putback_None), mPutbackCode(0), mPutbackInteger(0), mPutbackFloat(0),
|
|
|
|
mStrictKeywords (false), mTolerantNames (false), mIgnoreNewline(false)
|
|
|
|
mStrictKeywords (false), mTolerantNames (false), mIgnoreNewline(false), mExpectName(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Scanner::scan (Parser& parser)
|
|
|
|
void Scanner::scan (Parser& parser)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
while (scanToken (parser));
|
|
|
|
while (scanToken (parser));
|
|
|
|
|
|
|
|
mExpectName = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Scanner::putbackSpecial (int code, const TokenLoc& loc)
|
|
|
|
void Scanner::putbackSpecial (int code, const TokenLoc& loc)
|
|
|
@ -657,4 +670,9 @@ namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mTolerantNames = true;
|
|
|
|
mTolerantNames = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Scanner::enableExpectName()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mExpectName = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|