mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 08:15:35 +00:00
ignore additional string argument after enable/disable
This commit is contained in:
parent
61626e90da
commit
bfb0e62c4a
2 changed files with 12 additions and 4 deletions
|
@ -84,6 +84,13 @@ namespace Compiler
|
||||||
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
|
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
|
||||||
Scanner& scanner)
|
Scanner& scanner)
|
||||||
{
|
{
|
||||||
|
if (mState==PotentialEndState)
|
||||||
|
{
|
||||||
|
getErrorHandler().warning ("stay string argument (ignoring it)", loc);
|
||||||
|
mState = EndState;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (mState==SetState)
|
if (mState==SetState)
|
||||||
{
|
{
|
||||||
std::string name2 = Misc::StringUtils::lowerCase (name);
|
std::string name2 = Misc::StringUtils::lowerCase (name);
|
||||||
|
@ -219,13 +226,13 @@ namespace Compiler
|
||||||
case Scanner::K_enable:
|
case Scanner::K_enable:
|
||||||
|
|
||||||
Generator::enable (mCode, mLiterals, mExplicit);
|
Generator::enable (mCode, mLiterals, mExplicit);
|
||||||
mState = EndState;
|
mState = PotentialEndState;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Scanner::K_disable:
|
case Scanner::K_disable:
|
||||||
|
|
||||||
Generator::disable (mCode, mLiterals, mExplicit);
|
Generator::disable (mCode, mLiterals, mExplicit);
|
||||||
mState = EndState;
|
mState = PotentialEndState;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +413,8 @@ namespace Compiler
|
||||||
|
|
||||||
bool LineParser::parseSpecial (int code, const TokenLoc& loc, Scanner& scanner)
|
bool LineParser::parseSpecial (int code, const TokenLoc& loc, Scanner& scanner)
|
||||||
{
|
{
|
||||||
if (code==Scanner::S_newline && (mState==EndState || mState==BeginState))
|
if (code==Scanner::S_newline &&
|
||||||
|
(mState==EndState || mState==BeginState || mState==PotentialEndState))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (code==Scanner::S_comma && mState==MessageState)
|
if (code==Scanner::S_comma && mState==MessageState)
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Compiler
|
||||||
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
|
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
|
||||||
SetMemberVarState, SetMemberVarState2,
|
SetMemberVarState, SetMemberVarState2,
|
||||||
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
|
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
|
||||||
EndState,
|
EndState, PotentialEndState /* may have a stray string argument */,
|
||||||
PotentialExplicitState, ExplicitState, MemberState
|
PotentialExplicitState, ExplicitState, MemberState
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue