[ASTDumper] Use color when printing identifiers

Print identifiers using color, when available.
This commit is contained in:
Brian Gesiak
2016-12-26 14:00:06 -05:00
parent 02738a5e66
commit 11a46ff4ac

View File

@@ -1895,11 +1895,14 @@ public:
OS << " trailing-closure";
if (E->hasElementNames()) {
OS << " names=";
PrintWithColorRAII(OS, IdentifierColor) << " names=";
interleave(E->getElementNames(),
[&](Identifier name) { OS << (name.empty()?"''":name.str());},
[&] { OS << ","; });
[&](Identifier name) {
PrintWithColorRAII(OS, IdentifierColor)
<< (name.empty()?"''":name.str());
},
[&] { PrintWithColorRAII(OS, IdentifierColor) << ","; });
}
for (unsigned i = 0, e = E->getNumElements(); i != e; ++i) {