Use PType for typing things in PSymbolConst.
This commit is contained in:
parent
251cdacf26
commit
6584819d01
3 changed files with 11 additions and 12 deletions
|
|
@ -297,17 +297,16 @@ FxExpression *FxConstant::MakeConstant(PSymbol *sym, const FScriptPosition &pos)
|
|||
PSymbolConst *csym = dyn_cast<PSymbolConst>(sym);
|
||||
if (csym != NULL)
|
||||
{
|
||||
switch(csym->ValueType)
|
||||
if (csym->ValueType->IsA(RUNTIME_CLASS(PInt)))
|
||||
{
|
||||
case VAL_Int:
|
||||
x = new FxConstant(csym->Value, pos);
|
||||
break;
|
||||
|
||||
case VAL_Float:
|
||||
}
|
||||
else if (csym->ValueType->IsA(RUNTIME_CLASS(PFloat)))
|
||||
{
|
||||
x = new FxConstant(csym->Float, pos);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.Message(MSG_ERROR, "Invalid constant '%s'\n", csym->SymbolName.GetChars());
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue