mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
workaround for faulty endif in Morrowind scripts
This commit is contained in:
parent
e4ed5b836e
commit
4711135e7f
1 changed files with 13 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
#include "scriptparser.hpp"
|
||||
|
||||
#include "scanner.hpp"
|
||||
#include "skipparser.hpp"
|
||||
#include "errorhandler.hpp"
|
||||
|
||||
namespace Compiler
|
||||
{
|
||||
|
@ -41,6 +43,17 @@ namespace Compiler
|
|||
return true;
|
||||
}
|
||||
|
||||
/// \todo add an option to disable this nonsense
|
||||
if (keyword==Scanner::K_endif)
|
||||
{
|
||||
// surplus endif
|
||||
getErrorHandler().warning ("endif without matching if/elseif", loc);
|
||||
|
||||
SkipParser skip (getErrorHandler(), getContext());
|
||||
scanner.scan (skip);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keyword==Scanner::K_end && mEnd)
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue