Fixed type aliases handling
This commit is contained in:
@@ -226,8 +226,15 @@ std::string inheritable_diagram_options::simplify_template_type(
|
||||
type_aliases_longer_first_t aliases;
|
||||
aliases.insert(type_aliases().begin(), type_aliases().end());
|
||||
|
||||
for (const auto &[pattern, replacement] : aliases) {
|
||||
util::replace_all(full_name, pattern, replacement);
|
||||
bool matched{true};
|
||||
while (matched) {
|
||||
auto matched_in_iteration{false};
|
||||
for (const auto &[pattern, replacement] : aliases) {
|
||||
matched_in_iteration =
|
||||
util::replace_all(full_name, pattern, replacement) ||
|
||||
matched_in_iteration;
|
||||
}
|
||||
matched = matched_in_iteration;
|
||||
}
|
||||
|
||||
return full_name;
|
||||
|
||||
@@ -458,8 +458,18 @@ struct relationship_hint_t {
|
||||
using relationship_hints_t = std::map<std::string, relationship_hint_t>;
|
||||
|
||||
using type_aliases_t = std::map<std::string, std::string>;
|
||||
|
||||
struct type_aliases_longer_first_comparator {
|
||||
bool operator()(const std::string &a, const std::string &b) const
|
||||
{
|
||||
if (a.size() == b.size())
|
||||
return a > b;
|
||||
|
||||
return a.size() > b.size();
|
||||
}
|
||||
};
|
||||
using type_aliases_longer_first_t =
|
||||
std::map<std::string, std::string, std::greater<>>;
|
||||
std::map<std::string, std::string, type_aliases_longer_first_comparator>;
|
||||
|
||||
enum class location_t { marker, fileline, function };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user