Rename A_Int/A_Bool/A_State to int/bool/state

- This is an effort to emphasize that these are just type casts. Now they
  look like function-style casts with no action function styling.
  They do no magic joojoo at all. The only reason they exist is because
  the DECORATE parser can only parse return statements that call a
  function, so these satisfy that requirement. i.e. *return int(666);* is
  identical to *return 666;* (if the parser could handle the latter).
This commit is contained in:
Randy Heit 2016-02-20 22:05:17 -06:00
commit e7b9e7e955
5 changed files with 40 additions and 11 deletions

View file

@ -555,7 +555,9 @@ FxVMFunctionCall *ParseAction(FScanner &sc, FState state, FString statestring, B
return call;
}
PFunction *afd = dyn_cast<PFunction>(bag.Info->Symbols.FindSymbol(FName(sc.String, true), true));
FName symname = FName(sc.String, true);
symname = CheckCastKludges(symname);
PFunction *afd = dyn_cast<PFunction>(bag.Info->Symbols.FindSymbol(symname, true));
if (afd != NULL)
{
FArgumentList *args = new FArgumentList;
@ -678,3 +680,24 @@ void ParseFunctionParameters(FScanner &sc, PClassActor *cls, TArray<FxExpression
sc.MustGetStringName(")");
}
}
//==========================================================================
//
// CheckCastKludges
//
//==========================================================================
FName CheckCastKludges(FName in)
{
switch (in)
{
case NAME_Int:
return NAME___decorate_internal_int__;
case NAME_Bool:
return NAME___decorate_internal_bool__;
case NAME_State:
return NAME___decorate_internal_state__;
default:
return in;
}
}