Add min and max to DECORATE

This commit is contained in:
Randy Heit 2016-02-23 16:26:00 -06:00
commit 1ffb7ad109
6 changed files with 248 additions and 12 deletions

View file

@ -349,6 +349,21 @@ static FxExpression *ParseExpression0 (FScanner &sc, PClassActor *cls)
// a cheap way to get them working when people use "name" instead of 'name'.
return new FxConstant(FName(sc.String), scpos);
}
else if (sc.CheckToken(TK_Min) || sc.CheckToken(TK_Max))
{
int type = sc.TokenType;
TArray<FxExpression*> list;
sc.MustGetToken('(');
for (;;)
{
FxExpression *expr = ParseExpressionM(sc, cls);
list.Push(expr);
if (sc.CheckToken(')'))
break;
sc.MustGetToken(',');
}
return new FxMinMax(list, type, sc);
}
else if (sc.CheckToken(TK_Random))
{
FRandom *rng;