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

Unified Diff: tools/gn/tokenizer.cc

Issue 1483903004: tools/gn: move the implementation of IsIdentifierXXX functions to the source file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/tokenizer.h ('k') | no next file » | 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 db10f6ae094946c11b659aca6dea43f207459f61..4dd71d5beaf953e66acaeb19a7d062270f632ee7 100644
--- a/tools/gn/tokenizer.cc
+++ b/tools/gn/tokenizer.cc
@@ -180,6 +180,16 @@ bool Tokenizer::IsNewline(const base::StringPiece& buffer, size_t offset) {
return buffer[offset] == '\n';
}
+// static
+bool Tokenizer::IsIdentifierFirstChar(char c) {
+ return base::IsAsciiAlpha(c) || c == '_';
+}
+
+// static
+bool Tokenizer::IsIdentifierContinuingChar(char c) {
+ // Also allow digits after the first char.
+ return IsIdentifierFirstChar(c) || base::IsAsciiDigit(c);
+}
void Tokenizer::AdvanceToNextToken() {
while (!at_end() && IsCurrentWhitespace())
« no previous file with comments | « tools/gn/tokenizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698