DECORATE can now handle jump statements

break and continue were added but are not yet useable anywhere
This was made general enough so that loops and switch statements that accept breaks/continues can be done without much difficulty as well as goto statements with explicit labels if those are ever wanted
This commit is contained in:
Leonard2 2016-07-26 23:57:26 +02:00 committed by Christoph Oelckers
commit c4eafc1c38
3 changed files with 121 additions and 22 deletions

View file

@ -529,6 +529,18 @@ FxExpression *ParseActions(FScanner &sc, FState state, FString statestring, Bagg
sc.MustGetString();
add = new FxReturnStatement(retexp, sc);
}
else if (sc.Compare("break"))
{
add = new FxJumpStatement(TK_Break, sc);
sc.MustGetStringName(";");
sc.MustGetString();
}
else if (sc.Compare("continue"))
{
add = new FxJumpStatement(TK_Continue, sc);
sc.MustGetStringName(";");
sc.MustGetString();
}
else
{ // Handle a regular action function call
add = ParseAction(sc, state, statestring, bag);