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()) |