workaround for faulty endif in Morrowind scripts

actorid
Marc Zinnschlag 12 years ago
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…
Cancel
Save