prettyPrint -> shouldPrettyPrint

This commit is contained in:
Rebecca Turner 2024-02-08 10:17:20 -08:00
parent a27651908f
commit 1c5f5d4291
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View file

@ -71,7 +71,7 @@ struct PrintOptions
/** /**
* True if pretty-printing is enabled. * True if pretty-printing is enabled.
*/ */
inline bool prettyPrint() inline bool shouldPrettyPrint()
{ {
return prettyIndent > 0; return prettyIndent > 0;
} }

View file

@ -168,14 +168,14 @@ private:
void increaseIndent() void increaseIndent()
{ {
if (options.prettyPrint()) { if (options.shouldPrettyPrint()) {
indent.append(options.prettyIndent, ' '); indent.append(options.prettyIndent, ' ');
} }
} }
void decreaseIndent() void decreaseIndent()
{ {
if (options.prettyPrint()) { if (options.shouldPrettyPrint()) {
assert(indent.size() >= options.prettyIndent); assert(indent.size() >= options.prettyIndent);
indent.resize(indent.size() - options.prettyIndent); indent.resize(indent.size() - options.prettyIndent);
} }
@ -279,7 +279,7 @@ private:
bool shouldPrettyPrintAttrs(AttrVec & v) bool shouldPrettyPrintAttrs(AttrVec & v)
{ {
if (!options.prettyPrint() || v.empty()) { if (!options.shouldPrettyPrint() || v.empty()) {
return false; return false;
} }
@ -356,7 +356,7 @@ private:
bool shouldPrettyPrintList(std::span<Value * const> list) bool shouldPrettyPrintList(std::span<Value * const> list)
{ {
if (!options.prettyPrint() || list.empty()) { if (!options.shouldPrettyPrint() || list.empty()) {
return false; return false;
} }