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

Unified Diff: tools/gn/tokenizer.cc

Issue 207233003: Add "." accessors to GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/token.h ('k') | tools/gn/tokenizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/tokenizer.cc
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc
index 8acabdb46541b6b6a76d5de40fa97d9bdb6dd3cd..36c969144e8c08f5b87dc72e40082cd326cda8c3 100644
--- a/tools/gn/tokenizer.cc
+++ b/tools/gn/tokenizer.cc
@@ -64,6 +64,8 @@ Token::Type GetSpecificOperatorType(base::StringPiece value) {
return Token::BOOLEAN_OR;
if (value == "!")
return Token::BANG;
+ if (value == ".")
+ return Token::DOT;
return Token::INVALID;
}
@@ -196,6 +198,8 @@ Token::Type Tokenizer::ClassifyCurrent() const {
if (next_char == '}')
return Token::RIGHT_BRACE;
+ if (next_char == '.')
+ return Token::DOT;
if (next_char == ',')
return Token::COMMA;
@@ -283,6 +287,7 @@ void Tokenizer::AdvanceToEndOfToken(const Location& location,
case Token::RIGHT_BRACE:
case Token::LEFT_PAREN:
case Token::RIGHT_PAREN:
+ case Token::DOT:
case Token::COMMA:
Advance(); // All are one char.
break;
« no previous file with comments | « tools/gn/token.h ('k') | tools/gn/tokenizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698