mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:23:52 +00:00
Merge pull request #1929 from Capostrophic/elseif
Ignore the rest of the line after else operator (bug #3006)
This commit is contained in:
commit
6cbf1288ff
2 changed files with 20 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Bug #2969: Scripted items can stack
|
Bug #2969: Scripted items can stack
|
||||||
Bug #2987: Editor: some chance and AI data fields can overflow
|
Bug #2987: Editor: some chance and AI data fields can overflow
|
||||||
|
Bug #3006: 'else if' operator breaks script compilation
|
||||||
Bug #3282: Unintended behaviour when assigning F3 and Windows keys
|
Bug #3282: Unintended behaviour when assigning F3 and Windows keys
|
||||||
Bug #3623: Fix HiDPI on Windows
|
Bug #3623: Fix HiDPI on Windows
|
||||||
Bug #3733: Normal maps are inverted on mirrored UVs
|
Bug #3733: Normal maps are inverted on mirrored UVs
|
||||||
|
|
|
@ -179,6 +179,14 @@ namespace Compiler
|
||||||
scanner.scan (mLineParser);
|
scanner.scan (mLineParser);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (mState==IfElseJunkState)
|
||||||
|
{
|
||||||
|
getErrorHandler().warning ("Ignoring extra text after else", loc);
|
||||||
|
SkipParser skip (getErrorHandler(), getContext());
|
||||||
|
scanner.scan (skip);
|
||||||
|
mState = IfElseBodyState;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return Parser::parseName (name, loc, scanner);
|
return Parser::parseName (name, loc, scanner);
|
||||||
}
|
}
|
||||||
|
@ -207,8 +215,7 @@ namespace Compiler
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mState==IfBodyState || mState==IfElseifBodyState || mState==IfElseBodyState ||
|
else if (mState==IfBodyState || mState==IfElseifBodyState || mState==IfElseBodyState)
|
||||||
mState==IfElseJunkState)
|
|
||||||
{
|
{
|
||||||
if (parseIfBody (keyword, loc, scanner))
|
if (parseIfBody (keyword, loc, scanner))
|
||||||
return true;
|
return true;
|
||||||
|
@ -218,6 +225,14 @@ namespace Compiler
|
||||||
if ( parseWhileBody (keyword, loc, scanner))
|
if ( parseWhileBody (keyword, loc, scanner))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (mState==IfElseJunkState)
|
||||||
|
{
|
||||||
|
getErrorHandler().warning ("Ignoring extra text after else", loc);
|
||||||
|
SkipParser skip (getErrorHandler(), getContext());
|
||||||
|
scanner.scan (skip);
|
||||||
|
mState = IfElseBodyState;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return Parser::parseKeyword (keyword, loc, scanner);
|
return Parser::parseKeyword (keyword, loc, scanner);
|
||||||
}
|
}
|
||||||
|
@ -250,8 +265,9 @@ namespace Compiler
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (code==Scanner::S_open && mState==IfElseJunkState)
|
else if (mState==IfElseJunkState)
|
||||||
{
|
{
|
||||||
|
getErrorHandler().warning ("Ignoring extra text after else", loc);
|
||||||
SkipParser skip (getErrorHandler(), getContext());
|
SkipParser skip (getErrorHandler(), getContext());
|
||||||
scanner.scan (skip);
|
scanner.scan (skip);
|
||||||
mState = IfElseBodyState;
|
mState = IfElseBodyState;
|
||||||
|
|
Loading…
Reference in a new issue