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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "tools/gn/commands.h" | 10 #include "tools/gn/commands.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 } | 282 } |
283 | 283 |
284 void Printer::AnnotatePreferedMultilineAssignment(const BinaryOpNode* binop) { | 284 void Printer::AnnotatePreferedMultilineAssignment(const BinaryOpNode* binop) { |
285 const IdentifierNode* ident = binop->left()->AsIdentifier(); | 285 const IdentifierNode* ident = binop->left()->AsIdentifier(); |
286 const ListNode* list = binop->right()->AsList(); | 286 const ListNode* list = binop->right()->AsList(); |
287 // This is somewhat arbitrary, but we include the 'deps'- and 'sources'-like | 287 // This is somewhat arbitrary, but we include the 'deps'- and 'sources'-like |
288 // things, but not flags things. | 288 // things, but not flags things. |
289 if (binop->op().value() == "=" && ident && list && | 289 if (binop->op().value() == "=" && ident && list && |
290 (ident->value().value() == "data" || | 290 (ident->value().value() == "data" || |
291 ident->value().value() == "datadeps" || | 291 ident->value().value() == "datadeps" || |
292 ident->value().value() == "deps" || ident->value().value() == "inputs" || | 292 ident->value().value() == "deps" || ident->value().value() == "inputs" || |
tfarina
2014/12/03 21:19:12
would you mind moving the "inputs" part into its o
| |
293 ident->value().value() == "outputs" || | |
293 ident->value().value() == "public" || | 294 ident->value().value() == "public" || |
294 ident->value().value() == "public_deps" || | 295 ident->value().value() == "public_deps" || |
295 ident->value().value() == "sources")) { | 296 ident->value().value() == "sources")) { |
296 const_cast<ListNode*>(list)->set_prefer_multiline(true); | 297 const_cast<ListNode*>(list)->set_prefer_multiline(true); |
297 } | 298 } |
298 } | 299 } |
299 | 300 |
300 bool Printer::ShouldAddBlankLineInBetween(const ParseNode* a, | 301 bool Printer::ShouldAddBlankLineInBetween(const ParseNode* a, |
301 const ParseNode* b) { | 302 const ParseNode* b) { |
302 LocationRange a_range = a->GetRange(); | 303 LocationRange a_range = a->GetRange(); |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1004 } | 1005 } |
1005 } else { | 1006 } else { |
1006 printf("%s", output_string.c_str()); | 1007 printf("%s", output_string.c_str()); |
1007 } | 1008 } |
1008 } | 1009 } |
1009 | 1010 |
1010 return 0; | 1011 return 0; |
1011 } | 1012 } |
1012 | 1013 |
1013 } // namespace commands | 1014 } // namespace commands |
OLD | NEW |