added json for SPF_GetAllDeclaratedArrays pass

This commit is contained in:
ALEXks
2025-05-07 19:59:54 +03:00
parent 0a4b795900
commit 99f5febd58
3 changed files with 69 additions and 6 deletions

View File

@@ -1416,14 +1416,17 @@ int SPF_GetAllDeclaratedArrays(void*& context, int winHandler, short *options, s
{
runPassesForVisualizer(projName, { GET_ALL_ARRAY_DECL });
string resVal = "";
for (auto f = declaredArrays.begin(); f != declaredArrays.end(); ++f)
json arrays = json::array();
for (const auto& [_, array] : declaredArrays)
{
if (f != declaredArrays.begin())
resVal += "@";
resVal += f->second.first->toString();
json jArray = array.first->toJson();
arrays.push_back(jArray);
}
json allArrays;
allArrays["allArrays"] = arrays;
string resVal = allArrays.dump();
copyStringToShort(result, resVal);
retSize = (int)resVal.size() + 1;
}