mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
workaround for faulty endif in Morrowind scripts
This commit is contained in:
parent
e4ed5b836e
commit
4711135e7f
@ -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 New Issue
Block a user