backend update from Raze.

Mainly a VMFunction script type and some associated utilities.
This commit is contained in:
Christoph Oelckers 2023-10-09 18:45:30 +02:00
commit 79f2fc6553
13 changed files with 79 additions and 3 deletions

View file

@ -6358,6 +6358,16 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx)
ABORT(newex);
goto foundit;
}
else if (sym->IsKindOf(RUNTIME_CLASS(PFunction)))
{
if (ctx.Version >= MakeVersion(4, 11, 100))
{
// VMFunction is only supported since 4.12 and Raze 1.8.
newex = new FxConstant(static_cast<PFunction*>(sym)->Variants[0].Implementation, ScriptPosition);
goto foundit;
}
}
}
// now check in the owning class.
@ -6369,6 +6379,15 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx)
newex = FxConstant::MakeConstant(sym, ScriptPosition);
goto foundit;
}
else if (sym->IsKindOf(RUNTIME_CLASS(PFunction)))
{
if (ctx.Version >= MakeVersion(4, 11, 100))
{
// VMFunction is only supported since 4.12 and Raze 1.8.
newex = new FxConstant(static_cast<PFunction*>(sym)->Variants[0].Implementation, ScriptPosition);
goto foundit;
}
}
else if (ctx.Function == nullptr)
{
ScriptPosition.Message(MSG_ERROR, "Unable to access class member %s from constant declaration", sym->SymbolName.GetChars());