parent
59683733f5
commit
9d4697453f
|
@ -103,11 +103,18 @@ void ExprAttrs::show(std::ostream & str) const
|
||||||
{
|
{
|
||||||
if (recursive) str << "rec ";
|
if (recursive) str << "rec ";
|
||||||
str << "{ ";
|
str << "{ ";
|
||||||
for (auto & i : attrs)
|
typedef const decltype(attrs)::value_type * Attr;
|
||||||
if (i.second.inherited)
|
std::vector<Attr> sorted;
|
||||||
str << "inherit " << i.first << " " << "; ";
|
for (auto & i : attrs) sorted.push_back(&i);
|
||||||
|
std::sort(sorted.begin(), sorted.end(), [](Attr a, Attr b) {
|
||||||
|
return (const std::string &) a->first < (const std::string &) b->first;
|
||||||
|
});
|
||||||
|
for (auto & i : sorted) {
|
||||||
|
if (i->second.inherited)
|
||||||
|
str << "inherit " << i->first << " " << "; ";
|
||||||
else
|
else
|
||||||
str << i.first << " = " << *i.second.e << "; ";
|
str << i->first << " = " << *i->second.e << "; ";
|
||||||
|
}
|
||||||
for (auto & i : dynamicAttrs)
|
for (auto & i : dynamicAttrs)
|
||||||
str << "\"${" << *i.nameExpr << "}\" = " << *i.valueExpr << "; ";
|
str << "\"${" << *i.nameExpr << "}\" = " << *i.valueExpr << "; ";
|
||||||
str << "}";
|
str << "}";
|
||||||
|
|
Loading…
Reference in a new issue