| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 void Printer::AnnotatePreferredMultilineAssignment(const BinaryOpNode* binop) { | 302 void Printer::AnnotatePreferredMultilineAssignment(const BinaryOpNode* binop) { |
| 303 const IdentifierNode* ident = binop->left()->AsIdentifier(); | 303 const IdentifierNode* ident = binop->left()->AsIdentifier(); |
| 304 const ListNode* list = binop->right()->AsList(); | 304 const ListNode* list = binop->right()->AsList(); |
| 305 // This is somewhat arbitrary, but we include the 'deps'- and 'sources'-like | 305 // This is somewhat arbitrary, but we include the 'deps'- and 'sources'-like |
| 306 // things, but not flags things. | 306 // things, but not flags things. |
| 307 if (binop->op().value() == "=" && ident && list) { | 307 if (binop->op().value() == "=" && ident && list) { |
| 308 const base::StringPiece lhs = ident->value().value(); | 308 const base::StringPiece lhs = ident->value().value(); |
| 309 if (lhs == "data" || lhs == "datadeps" || lhs == "data_deps" || | 309 if (lhs == "data" || lhs == "datadeps" || lhs == "data_deps" || |
| 310 lhs == "deps" || lhs == "inputs" || lhs == "outputs" || | 310 lhs == "deps" || lhs == "inputs" || lhs == "outputs" || |
| 311 lhs == "public" || lhs == "public_deps" || lhs == "sources") { | 311 lhs == "public" || lhs == "public_deps" || lhs == "sources" || |
| 312 lhs == "bundle_data") { |
| 312 const_cast<ListNode*>(list)->set_prefer_multiline(true); | 313 const_cast<ListNode*>(list)->set_prefer_multiline(true); |
| 313 } | 314 } |
| 314 } | 315 } |
| 315 } | 316 } |
| 316 | 317 |
| 317 void Printer::SortIfSourcesOrDeps(const BinaryOpNode* binop) { | 318 void Printer::SortIfSourcesOrDeps(const BinaryOpNode* binop) { |
| 318 const IdentifierNode* ident = binop->left()->AsIdentifier(); | 319 const IdentifierNode* ident = binop->left()->AsIdentifier(); |
| 319 const ListNode* list = binop->right()->AsList(); | 320 const ListNode* list = binop->right()->AsList(); |
| 320 if ((binop->op().value() == "=" || binop->op().value() == "+=" || | 321 if ((binop->op().value() == "=" || binop->op().value() == "+=" || |
| 321 binop->op().value() == "-=") && | 322 binop->op().value() == "-=") && |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 } | 1053 } |
| 1053 } else { | 1054 } else { |
| 1054 printf("%s", output_string.c_str()); | 1055 printf("%s", output_string.c_str()); |
| 1055 } | 1056 } |
| 1056 } | 1057 } |
| 1057 | 1058 |
| 1058 return 0; | 1059 return 0; |
| 1059 } | 1060 } |
| 1060 | 1061 |
| 1061 } // namespace commands | 1062 } // namespace commands |
| OLD | NEW |