Reorder pick parsing to require one parameter.

- This function is pointless without any parameters, so don't allow that.
This commit is contained in:
Randy Heit 2014-12-21 21:22:14 -06:00
parent 549ba3d817
commit 2b323d01ed

View file

@ -390,16 +390,14 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls)
}
sc.MustGetToken('(');
while (!(sc.CheckToken(')')))
for (;;)
{
FxExpression *min = ParseExpressionM(sc, cls);
list.Push(min);
FxExpression *expr = ParseExpressionM(sc, cls);
list.Push(expr);
if (sc.CheckToken(')'))
break;
else
sc.MustGetToken(',');
sc.MustGetToken(',');
}
return new FxPick(rng, list, sc);
}
else if (sc.CheckToken(TK_FRandom))