mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
allow (and discard) explicit reference on instructions that do not accept explicit references
This commit is contained in:
parent
9de2922d22
commit
697bda6371
3 changed files with 21 additions and 4 deletions
|
@ -234,8 +234,15 @@ namespace Compiler
|
|||
{
|
||||
std::string argumentType;
|
||||
|
||||
if (extensions->isInstruction (keyword, argumentType, mState==ExplicitState))
|
||||
bool hasExplicit = mState==ExplicitState;
|
||||
if (extensions->isInstruction (keyword, argumentType, hasExplicit))
|
||||
{
|
||||
if (!hasExplicit && mState==ExplicitState)
|
||||
{
|
||||
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
|
||||
mExplicit.clear();
|
||||
}
|
||||
|
||||
int optionals = mExprParser.parseArguments (argumentType, scanner, mCode, true);
|
||||
|
||||
extensions->generateInstructionCode (keyword, mCode, mLiterals, mExplicit, optionals);
|
||||
|
@ -271,6 +278,14 @@ namespace Compiler
|
|||
}
|
||||
}
|
||||
|
||||
if (mState==ExplicitState)
|
||||
{
|
||||
// drop stray explicit reference
|
||||
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
|
||||
mState = BeginState;
|
||||
mExplicit.clear();
|
||||
}
|
||||
|
||||
if (mState==BeginState)
|
||||
{
|
||||
switch (keyword)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue