Select variables used by exported macros by default in export dialog

This commit is contained in:
WarmUpTill
2026-10-19 19:03:23 +02:00
committed by WarmUpTill
parent 1bfe56992b
commit 0924f14d20
8 changed files with 185 additions and 84 deletions

View File

@@ -41,4 +41,18 @@ std::unordered_map<std::string, int> GetVariablesUsedByMacro(Macro *macro)
return collectReferences(macro);
}
std::unordered_map<std::string, int>
GetVariablesUsedByMacros(const std::vector<std::shared_ptr<Macro>> &macros)
{
std::unordered_map<std::string, int> result;
auto lock = LockContext();
for (const auto &macro : macros) {
for (const auto &[name, count] :
collectReferences(macro.get())) {
result[name] += count;
}
}
return result;
}
} // namespace advss