|
|
|
@ -13,15 +13,13 @@
|
|
|
|
|
namespace Compiler
|
|
|
|
|
{
|
|
|
|
|
StringParser::StringParser (ErrorHandler& errorHandler, const Context& context, Literals& literals)
|
|
|
|
|
: Parser (errorHandler, context), mLiterals (literals), mState (StartState), mSmashCase (false), mDiscard (false)
|
|
|
|
|
: Parser (errorHandler, context), mLiterals (literals), mSmashCase (false), mDiscard (false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool StringParser::parseName (const std::string& name, const TokenLoc& loc,
|
|
|
|
|
Scanner& scanner)
|
|
|
|
|
{
|
|
|
|
|
if (mState==StartState || mState==CommaState)
|
|
|
|
|
{
|
|
|
|
|
start();
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
@ -37,9 +35,6 @@ namespace Compiler
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseName (name, loc, scanner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool StringParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
|
|
|
|
|
{
|
|
|
|
|
if (const Extensions *extensions = getContext().getExtensions())
|
|
|
|
@ -75,17 +70,6 @@ namespace Compiler
|
|
|
|
|
return Parser::parseKeyword (keyword, loc, scanner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool StringParser::parseSpecial (int code, const TokenLoc& loc, Scanner& scanner)
|
|
|
|
|
{
|
|
|
|
|
if (code==Scanner::S_comma && mState==StartState)
|
|
|
|
|
{
|
|
|
|
|
mState = CommaState;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseSpecial (code, loc, scanner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool StringParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner)
|
|
|
|
|
{
|
|
|
|
|
reportWarning("Treating integer argument as a string", loc);
|
|
|
|
@ -99,7 +83,6 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
void StringParser::reset()
|
|
|
|
|
{
|
|
|
|
|
mState = StartState;
|
|
|
|
|
mCode.clear();
|
|
|
|
|
mSmashCase = false;
|
|
|
|
|
mTokenLoc = TokenLoc();
|
|
|
|
|