Parse statements as expressions in sequences

This will be needed for assignment operators to work
This commit is contained in:
Leonard2 2016-08-05 17:07:51 +02:00 committed by Christoph Oelckers
parent ab837b608d
commit 078881a941

View file

@ -539,7 +539,8 @@ static FxExpression *ParseFor(FScanner &sc, FState state, FString statestring, B
sc.MustGetString(); sc.MustGetString();
if (!sc.Compare(";")) if (!sc.Compare(";"))
{ {
init = ParseAction(sc, state, statestring, bag); // That's all DECORATE can handle for now. sc.UnGet();
init = ParseExpression(sc, bag.Info);
sc.MustGetStringName(";"); sc.MustGetStringName(";");
} }
sc.MustGetString(); sc.MustGetString();
@ -552,7 +553,8 @@ static FxExpression *ParseFor(FScanner &sc, FState state, FString statestring, B
sc.MustGetString(); sc.MustGetString();
if (!sc.Compare(")")) if (!sc.Compare(")"))
{ {
iter = ParseAction(sc, state, statestring, bag); sc.UnGet();
iter = ParseExpression(sc, bag.Info);
sc.MustGetStringName(")"); sc.MustGetStringName(")");
} }
@ -641,8 +643,9 @@ FxExpression *ParseActions(FScanner &sc, FState state, FString statestring, Bagg
sc.MustGetString(); sc.MustGetString();
} }
else else
{ // Handle a regular action function call { // Handle a regular expression
add = ParseAction(sc, state, statestring, bag); sc.UnGet();
add = ParseExpression(sc, bag.Info);
sc.MustGetStringName(";"); sc.MustGetStringName(";");
sc.MustGetString(); sc.MustGetString();
} }