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

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

Issue 23532076: GN: Add logging for the location of an invocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iadd .cc file Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/location.cc ('k') | 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 "tools/gn/input_file.h" 8 #include "tools/gn/input_file.h"
9 9
10 namespace { 10 namespace {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (value == "<") 57 if (value == "<")
58 return Token::LESS_THAN; 58 return Token::LESS_THAN;
59 if (value == ">") 59 if (value == ">")
60 return Token::GREATER_THAN; 60 return Token::GREATER_THAN;
61 if (value == "&&") 61 if (value == "&&")
62 return Token::BOOLEAN_AND; 62 return Token::BOOLEAN_AND;
63 if (value == "||") 63 if (value == "||")
64 return Token::BOOLEAN_OR; 64 return Token::BOOLEAN_OR;
65 if (value == "!") 65 if (value == "!")
66 return Token::BANG; 66 return Token::BANG;
67 NOTREACHED();
68 return Token::INVALID; 67 return Token::INVALID;
69 } 68 }
70 69
71 } // namespace 70 } // namespace
72 71
73 Tokenizer::Tokenizer(const InputFile* input_file, Err* err) 72 Tokenizer::Tokenizer(const InputFile* input_file, Err* err)
74 : input_file_(input_file), 73 : input_file_(input_file),
75 input_(input_file->contents()), 74 input_(input_file->contents()),
76 err_(err), 75 err_(err),
77 cur_(0), 76 cur_(0),
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } else if (cur_char() == '/' && cur_ + 1 < input_.size() && 356 } else if (cur_char() == '/' && cur_ + 1 < input_.size() &&
358 (input_[cur_ + 1] == '/' || input_[cur_ + 1] == '*')) { 357 (input_[cur_ + 1] == '/' || input_[cur_ + 1] == '*')) {
359 // Different types of comments. 358 // Different types of comments.
360 help = "Comments should start with # instead"; 359 help = "Comments should start with # instead";
361 } else { 360 } else {
362 help = "I have no idea what this is."; 361 help = "I have no idea what this is.";
363 } 362 }
364 363
365 return Err(location, "Invalid token.", help); 364 return Err(location, "Invalid token.", help);
366 } 365 }
OLDNEW
« no previous file with comments | « tools/gn/location.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698