mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
allow elseif without matching if (grrrrr)
This commit is contained in:
parent
858dc80292
commit
cd9b137129
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "scanner.hpp"
|
#include "scanner.hpp"
|
||||||
#include "generator.hpp"
|
#include "generator.hpp"
|
||||||
|
#include "errorhandler.hpp"
|
||||||
|
|
||||||
namespace Compiler
|
namespace Compiler
|
||||||
{
|
{
|
||||||
@ -186,8 +187,11 @@ namespace Compiler
|
|||||||
{
|
{
|
||||||
if (mState==StartState)
|
if (mState==StartState)
|
||||||
{
|
{
|
||||||
if (keyword==Scanner::K_if)
|
if (keyword==Scanner::K_if || keyword==Scanner::K_elseif)
|
||||||
{
|
{
|
||||||
|
if (keyword==Scanner::K_elseif)
|
||||||
|
getErrorHandler().warning ("elseif without matching if", loc);
|
||||||
|
|
||||||
mExprParser.reset();
|
mExprParser.reset();
|
||||||
scanner.scan (mExprParser);
|
scanner.scan (mExprParser);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace Compiler
|
|||||||
|
|
||||||
bool ScriptParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
|
bool ScriptParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
|
||||||
{
|
{
|
||||||
if (keyword==Scanner::K_while || keyword==Scanner::K_if)
|
if (keyword==Scanner::K_while || keyword==Scanner::K_if || keyword==Scanner::K_elseif)
|
||||||
{
|
{
|
||||||
mControlParser.reset();
|
mControlParser.reset();
|
||||||
if (mControlParser.parseKeyword (keyword, loc, scanner))
|
if (mControlParser.parseKeyword (keyword, loc, scanner))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user