fixed BUILD_INCLUDE_DEPENDENCIES pass
This commit is contained in:
@@ -1308,7 +1308,7 @@ int SPF_GetIntrinsics(void*& context, short *&result)
|
||||
return (int)resVal.size() + 1;
|
||||
}
|
||||
|
||||
extern map<string, vector<pair<int, string>>> includeDependencies;
|
||||
extern map<string, map<int, set<string>>> includeDependencies;
|
||||
int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, short *projName, short *&result, short*& output, int*& outputSize,
|
||||
short*& outputMessage, int*& outputMessageSize)
|
||||
{
|
||||
@@ -1328,12 +1328,15 @@ int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, s
|
||||
includes["file"] = deps.first;
|
||||
|
||||
json array = json::array();
|
||||
for (const auto& [line, incl] : deps.second)
|
||||
for (const auto& [line, incls] : deps.second)
|
||||
{
|
||||
json elem;
|
||||
elem["line"] = line;
|
||||
elem["dependencyFileName"] = incl;
|
||||
array.push_back(elem);
|
||||
for (auto& incl : incls)
|
||||
{
|
||||
json elem;
|
||||
elem["line"] = line;
|
||||
elem["dependencyFileName"] = incl;
|
||||
array.push_back(elem);
|
||||
}
|
||||
}
|
||||
includes["includes"] = array;
|
||||
inc_array.push_back(includes);
|
||||
@@ -2189,7 +2192,7 @@ int SPF_InlineProcedures(void*& context, int winHandler, short* options, short*
|
||||
}
|
||||
|
||||
|
||||
extern map<string, vector<pair<int, string>>> filesToInclude;
|
||||
extern map<string, map<int, set<string>>> filesToInclude;
|
||||
int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short *projName, short *folderName, char *visFilesToInclude,
|
||||
short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize)
|
||||
{
|
||||
@@ -2222,9 +2225,8 @@ int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short
|
||||
if (sscanf(splited[k].c_str(), "%d", &line) == -1)
|
||||
return -5;
|
||||
|
||||
auto pair = make_pair(line, splited[k + 1]);
|
||||
filesToInclude[file].push_back(pair);
|
||||
__spf_print(1, " include = [%d %s]\n", pair.first, pair.second.c_str());
|
||||
filesToInclude[file][line].insert(splited[k + 1]);
|
||||
__spf_print(1, " include = [%d %s]\n", line, splited[k + 1].c_str());
|
||||
}
|
||||
i += 2 * num;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user