|
|
@ -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;
|
|
|
|