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

Side by Side Diff: tools/gn/standard_out.cc

Issue 1130183007: Add runtime dependency extraction for GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make msvc happy Created 5 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « tools/gn/runtime_deps_unittest.cc ('k') | tools/gn/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/standard_out.h" 5 #include "tools/gn/standard_out.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 // Highlight up to the colon (if any). 234 // Highlight up to the colon (if any).
235 size_t chars_to_highlight = line.find(':'); 235 size_t chars_to_highlight = line.find(':');
236 if (chars_to_highlight == std::string::npos) 236 if (chars_to_highlight == std::string::npos)
237 chars_to_highlight = line.size(); 237 chars_to_highlight = line.size();
238 238
239 OutputString(line.substr(0, chars_to_highlight), DECORATION_YELLOW); 239 OutputString(line.substr(0, chars_to_highlight), DECORATION_YELLOW);
240 OutputString(line.substr(chars_to_highlight) + "\n"); 240 OutputString(line.substr(chars_to_highlight) + "\n");
241 continue; 241 continue;
242 } else if (!line.empty() && !in_body) { 242 } else if (is_markdown && !line.empty() && !in_body) {
243 OutputString("```\n", DECORATION_NONE); 243 OutputString("```\n", DECORATION_NONE);
244 in_body = true; 244 in_body = true;
245 } 245 }
246 246
247 // Check for a comment. 247 // Check for a comment.
248 TextDecoration dec = DECORATION_NONE; 248 TextDecoration dec = DECORATION_NONE;
249 for (const auto& elem : line) { 249 for (const auto& elem : line) {
250 if (elem == '#' && !is_markdown) { 250 if (elem == '#' && !is_markdown) {
251 // Got a comment, draw dimmed. 251 // Got a comment, draw dimmed.
252 dec = DECORATION_DIM; 252 dec = DECORATION_DIM;
253 break; 253 break;
254 } else if (elem != ' ') { 254 } else if (elem != ' ') {
255 break; 255 break;
256 } 256 }
257 } 257 }
258 258
259 OutputString(line + "\n", dec); 259 OutputString(line + "\n", dec);
260 } 260 }
261 261
262 if (is_markdown && in_body) 262 if (is_markdown && in_body)
263 OutputString("\n```\n"); 263 OutputString("\n```\n");
264 } 264 }
265 265
OLDNEW
« no previous file with comments | « tools/gn/runtime_deps_unittest.cc ('k') | tools/gn/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698