From 3fb9e754f1e1f0fbcd267712aa44386987487e54 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 23 Dec 2014 21:46:27 -0600 Subject: [PATCH] Rename 'Pick' to 'RandomPick' ... because 'pick' is way too generic a name to spend a keyword on. --- src/sc_man_scanner.re | 2 +- src/sc_man_tokens.h | 2 +- src/thingdef/thingdef_exp.cpp | 4 ++-- src/thingdef/thingdef_exp.h | 6 +++--- src/thingdef/thingdef_expression.cpp | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sc_man_scanner.re b/src/sc_man_scanner.re index 3a7f717a8..52a5d9f61 100644 --- a/src/sc_man_scanner.re +++ b/src/sc_man_scanner.re @@ -158,7 +158,7 @@ std2: 'random' { RET(TK_Random); } 'random2' { RET(TK_Random2); } 'frandom' { RET(TK_FRandom); } - 'pick' { RET(TK_Pick); } + 'randompick' { RET(TK_RandomPick); } L (L|D)* { RET(TK_Identifier); } diff --git a/src/sc_man_tokens.h b/src/sc_man_tokens.h index 1c22046c9..22f6e9cd4 100644 --- a/src/sc_man_tokens.h +++ b/src/sc_man_tokens.h @@ -122,5 +122,5 @@ xx(TK_Array, "'array'") xx(TK_In, "'in'") xx(TK_SizeOf, "'sizeof'") xx(TK_AlignOf, "'alignof'") -xx(TK_Pick, "'pick'") +xx(TK_RandomPick, "'randompick'") #undef xx diff --git a/src/thingdef/thingdef_exp.cpp b/src/thingdef/thingdef_exp.cpp index 2ad741294..7bd10b38d 100644 --- a/src/thingdef/thingdef_exp.cpp +++ b/src/thingdef/thingdef_exp.cpp @@ -371,7 +371,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls) return new FxRandom(rng, min, max, sc); } - else if (sc.CheckToken(TK_Pick)) + else if (sc.CheckToken(TK_RandomPick)) { FRandom *rng; TArray list; @@ -398,7 +398,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls) break; sc.MustGetToken(','); } - return new FxPick(rng, list, sc); + return new FxRandomPick(rng, list, sc); } else if (sc.CheckToken(TK_FRandom)) { diff --git a/src/thingdef/thingdef_exp.h b/src/thingdef/thingdef_exp.h index 0e03c661f..807ffcd87 100644 --- a/src/thingdef/thingdef_exp.h +++ b/src/thingdef/thingdef_exp.h @@ -559,7 +559,7 @@ public: // //========================================================================== -class FxPick : public FxExpression +class FxRandomPick : public FxExpression { protected: FRandom * rng; @@ -567,8 +567,8 @@ protected: public: - FxPick(FRandom *, TArray mi, const FScriptPosition &pos); - ~FxPick(); + FxRandomPick(FRandom *, TArray mi, const FScriptPosition &pos); + ~FxRandomPick(); FxExpression *Resolve(FCompileContext&); ExpVal EvalExpression(AActor *self); diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 913079bd2..d1c2eba9e 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -1696,7 +1696,7 @@ ExpVal FxRandom::EvalExpression (AActor *self) // // //========================================================================== -FxPick::FxPick(FRandom * r, TArray mi, const FScriptPosition &pos) +FxRandomPick::FxRandomPick(FRandom * r, TArray mi, const FScriptPosition &pos) : FxExpression(pos) { for (unsigned int index = 0; index < mi.Size(); index++) @@ -1713,7 +1713,7 @@ FxPick::FxPick(FRandom * r, TArray mi, const FScriptPosition &pos // //========================================================================== -FxPick::~FxPick() +FxRandomPick::~FxRandomPick() { } @@ -1723,7 +1723,7 @@ FxPick::~FxPick() // //========================================================================== -FxExpression *FxPick::Resolve(FCompileContext &ctx) +FxExpression *FxRandomPick::Resolve(FCompileContext &ctx) { CHECKRESOLVED(); for (unsigned int index = 0; index < min.Size(); index++) @@ -1741,7 +1741,7 @@ FxExpression *FxPick::Resolve(FCompileContext &ctx) // //========================================================================== -ExpVal FxPick::EvalExpression(AActor *self) +ExpVal FxRandomPick::EvalExpression(AActor *self) { ExpVal val; val.Type = VAL_Int;