|
|
@ -13,7 +13,7 @@
|
|
|
|
namespace Compiler
|
|
|
|
namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StringParser::StringParser (ErrorHandler& errorHandler, const Context& context, Literals& literals)
|
|
|
|
StringParser::StringParser (ErrorHandler& errorHandler, const Context& context, Literals& literals)
|
|
|
|
: Parser (errorHandler, context), mLiterals (literals), mState (StartState), mSmashCase (false)
|
|
|
|
: Parser (errorHandler, context), mLiterals (literals), mState (StartState), mSmashCase (false), mDiscard (false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -24,10 +24,15 @@ namespace Compiler
|
|
|
|
if (mState==StartState || mState==CommaState)
|
|
|
|
if (mState==StartState || mState==CommaState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
start();
|
|
|
|
start();
|
|
|
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mDiscard)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (mSmashCase)
|
|
|
|
if (mSmashCase)
|
|
|
|
Generator::pushString (mCode, mLiterals, Misc::StringUtils::lowerCase (name));
|
|
|
|
Generator::pushString (mCode, mLiterals, Misc::StringUtils::lowerCase (name));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
Generator::pushString (mCode, mLiterals, name);
|
|
|
|
Generator::pushString (mCode, mLiterals, name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -75,6 +80,8 @@ namespace Compiler
|
|
|
|
mState = StartState;
|
|
|
|
mState = StartState;
|
|
|
|
mCode.clear();
|
|
|
|
mCode.clear();
|
|
|
|
mSmashCase = false;
|
|
|
|
mSmashCase = false;
|
|
|
|
|
|
|
|
mTokenLoc = TokenLoc();
|
|
|
|
|
|
|
|
mDiscard = false;
|
|
|
|
Parser::reset();
|
|
|
|
Parser::reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -82,4 +89,14 @@ namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mSmashCase = true;
|
|
|
|
mSmashCase = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TokenLoc& StringParser::getTokenLoc() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return mTokenLoc;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StringParser::discard()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mDiscard = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|