1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 06:53:54 +02:00

Merge pull request #5223 from kvtb/patch-3

Expr::show(): avoid emiting meaningless chars
This commit is contained in:
Eelco Dolstra 2021-09-08 12:13:36 +02:00 committed by GitHub
commit a10644fa66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ void ExprAttrs::show(std::ostream & str) const
str << "{ "; str << "{ ";
for (auto & i : attrs) for (auto & i : attrs)
if (i.second.inherited) if (i.second.inherited)
str << "inherit " << i.first << " " << "; "; 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)
@ -211,7 +211,7 @@ string showAttrPath(const AttrPath & attrPath)
if (i.symbol.set()) if (i.symbol.set())
out << i.symbol; out << i.symbol;
else else
out << "\"${" << *i.expr << "}\""; out << "${" << *i.expr << "}";
} }
return out.str(); return out.str();
} }