Ignore bogus string arguments for Disable/Enable again

pull/2894/head
Capostrophic 5 years ago
parent 05884e690f
commit e02b66cdf4

@ -247,8 +247,8 @@ namespace Compiler
extensions.registerInstruction ("startscript", "c", opcodeStartScript, opcodeStartScriptExplicit);
extensions.registerInstruction ("stopscript", "c", opcodeStopScript);
extensions.registerFunction ("getsecondspassed", 'f', "", opcodeGetSecondsPassed);
extensions.registerInstruction ("enable", "", opcodeEnable, opcodeEnableExplicit);
extensions.registerInstruction ("disable", "", opcodeDisable, opcodeDisableExplicit);
extensions.registerInstruction ("enable", "x", opcodeEnable, opcodeEnableExplicit);
extensions.registerInstruction ("disable", "x", opcodeDisable, opcodeDisableExplicit);
extensions.registerFunction ("getdisabled", 'l', "x", opcodeGetDisabled, opcodeGetDisabledExplicit);
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate, opcodeOnActivateExplicit);

@ -86,13 +86,6 @@ namespace Compiler
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
Scanner& scanner)
{
if (mState==PotentialEndState)
{
getErrorHandler().warning ("Stray string argument", loc);
mState = EndState;
return true;
}
if (mState==SetState)
{
std::string name2 = Misc::StringUtils::lowerCase (name);
@ -445,8 +438,7 @@ namespace Compiler
return true;
}
if (code==Scanner::S_newline &&
(mState==EndState || mState==BeginState || mState==PotentialEndState))
if (code==Scanner::S_newline && (mState==EndState || mState==BeginState))
return false;
if (code==Scanner::S_comma && mState==MessageState)

@ -25,8 +25,7 @@ namespace Compiler
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
SetMemberVarState, SetMemberVarState2,
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
EndState, PotentialEndState /* may have a stray string argument */,
PotentialExplicitState, ExplicitState, MemberState
EndState, PotentialExplicitState, ExplicitState, MemberState
};
Locals& mLocals;

Loading…
Cancel
Save