Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1706)

Unified Diff: tools/gn/parse_tree.cc

Issue 748863003: gn format: penalty-based scheme for line breaking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-more-disabled
Patch Set: x64 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/parse_tree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parse_tree.cc
diff --git a/tools/gn/parse_tree.cc b/tools/gn/parse_tree.cc
index 9b2fc3f831a06118101695b4d4116094f844e9b6..1531747c57238613e5c36fb73b6ff5c28d4b6fa0 100644
--- a/tools/gn/parse_tree.cc
+++ b/tools/gn/parse_tree.cc
@@ -438,7 +438,7 @@ void IdentifierNode::Print(std::ostream& out, int indent) const {
// ListNode -------------------------------------------------------------------
-ListNode::ListNode() {
+ListNode::ListNode() : prefer_multiline_(false) {
}
ListNode::~ListNode() {
@@ -481,7 +481,8 @@ Err ListNode::MakeErrorDescribing(const std::string& msg,
}
void ListNode::Print(std::ostream& out, int indent) const {
- out << IndentFor(indent) << "LIST\n";
+ out << IndentFor(indent) << "LIST" << (prefer_multiline_ ? " multiline" : "")
+ << "\n";
PrintComments(out, indent);
for (const auto& cur : contents_)
cur->Print(out, indent + 1);
« no previous file with comments | « tools/gn/parse_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698