added json for SPF_GetAllDeclaratedArrays pass

This commit is contained in:
ALEXks
2025-05-11 08:33:50 +03:00
parent 12d3c2c8e5
commit 719e3723ae
2 changed files with 68 additions and 5 deletions

View File

@@ -1419,14 +1419,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;
}