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

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

Issue 1024333002: tools/gn: Give a better informative message if user uses apostrophe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bratell Created 5 years, 9 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 | « no previous file | no next file » | 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/tokenizer.h" 5 #include "tools/gn/tokenizer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "tools/gn/input_file.h" 9 #include "tools/gn/input_file.h"
10 10
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // Semicolon. 381 // Semicolon.
382 help = "Semicolons are not needed, delete this one."; 382 help = "Semicolons are not needed, delete this one.";
383 } else if (cur_char() == '\t') { 383 } else if (cur_char() == '\t') {
384 // Tab. 384 // Tab.
385 help = "You got a tab character in here. Tabs are evil. " 385 help = "You got a tab character in here. Tabs are evil. "
386 "Convert to spaces."; 386 "Convert to spaces.";
387 } else if (cur_char() == '/' && cur_ + 1 < input_.size() && 387 } else if (cur_char() == '/' && cur_ + 1 < input_.size() &&
388 (input_[cur_ + 1] == '/' || input_[cur_ + 1] == '*')) { 388 (input_[cur_ + 1] == '/' || input_[cur_ + 1] == '*')) {
389 // Different types of comments. 389 // Different types of comments.
390 help = "Comments should start with # instead"; 390 help = "Comments should start with # instead";
391 } else if (cur_char() == '\'') {
392 help = "Strings are delimited by \" characters, not apostrophes.";
391 } else { 393 } else {
392 help = "I have no idea what this is."; 394 help = "I have no idea what this is.";
393 } 395 }
394 396
395 return Err(location, "Invalid token.", help); 397 return Err(location, "Invalid token.", help);
396 } 398 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698