|
|
@ -26,6 +26,7 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
|
|
if (c=='\n')
|
|
|
|
if (c=='\n')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
mStrictKeywords = false;
|
|
|
|
mLoc.mColumn = 0;
|
|
|
|
mLoc.mColumn = 0;
|
|
|
|
++mLoc.mLine;
|
|
|
|
++mLoc.mLine;
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
|
mLoc.mLiteral.clear();
|
|
|
@ -294,8 +295,11 @@ namespace Compiler
|
|
|
|
name = name.substr (1, name.size()-2);
|
|
|
|
name = name.substr (1, name.size()-2);
|
|
|
|
// allow keywords enclosed in ""
|
|
|
|
// allow keywords enclosed in ""
|
|
|
|
/// \todo optionally disable
|
|
|
|
/// \todo optionally disable
|
|
|
|
// cont = parser.parseName (name, loc, *this);
|
|
|
|
if (mStrictKeywords)
|
|
|
|
// return true;
|
|
|
|
{
|
|
|
|
|
|
|
|
cont = parser.parseName (name, loc, *this);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
int i = 0;
|
|
|
@ -567,7 +571,8 @@ namespace Compiler
|
|
|
|
Scanner::Scanner (ErrorHandler& errorHandler, std::istream& inputStream,
|
|
|
|
Scanner::Scanner (ErrorHandler& errorHandler, std::istream& inputStream,
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -619,4 +624,9 @@ namespace Compiler
|
|
|
|
if (mExtensions)
|
|
|
|
if (mExtensions)
|
|
|
|
mExtensions->listKeywords (keywords);
|
|
|
|
mExtensions->listKeywords (keywords);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Scanner::enableStrictKeywords()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mStrictKeywords = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|