1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Update BfCompiler.cpp

Added name attribute
This commit is contained in:
Jannis 2024-08-14 09:00:53 +00:00 committed by GitHub
parent e98681d668
commit 288eb9eaad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -961,9 +961,21 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array<TestMethod>& test
{
testMethod.mName += "Ig";
}
else if (fieldDef->mName == "Name")
}
else if ((constant != NULL) && (constant->mTypeCode == BfTypeCode_StringId))
{
BfFieldDef* fieldDef = field.mFieldRef;
if (fieldDef->mName == "Name")
{
testMethod.mName += "Ovwn";
String* str = bfModule->GetStringPoolString(field.mParam.mValue, typeInstance->mConstHolder);
testMethod.mName += "Name";
String* temp = new String(*str);
temp->Replace('\t', "\\t"); //Good enough for now
temp->Replace('\n', "\\n");
temp->Replace('\a', "\\a");
temp->Replace('\v', "\\v");
testMethod.mName += *temp;
testMethod.mName += "\a";
}
}
}