mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 00:20:38 +00:00
- allow retrieving the length of a string constant.
This commit is contained in:
parent
6438416adb
commit
09f1859c83
1 changed files with 7 additions and 0 deletions
|
@ -9378,6 +9378,13 @@ FxExpression *FxStrLen::Resolve(FCompileContext &ctx)
|
||||||
{
|
{
|
||||||
SAFE_RESOLVE(Self, ctx);
|
SAFE_RESOLVE(Self, ctx);
|
||||||
assert(Self->ValueType == TypeString);
|
assert(Self->ValueType == TypeString);
|
||||||
|
if (Self->isConstant())
|
||||||
|
{
|
||||||
|
auto constself = static_cast<FxConstant *>(Self);
|
||||||
|
auto constlen = new FxConstant((int)constself->GetValue().GetString().Len(), Self->ScriptPosition);
|
||||||
|
delete this;
|
||||||
|
return constlen->Resolve(ctx);
|
||||||
|
}
|
||||||
ValueType = TypeUInt32;
|
ValueType = TypeUInt32;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue