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

Unified Diff: src/parsing/token.cc

Issue 2240513003: Scanner::LiteralBuffer usage cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Avoid more int conversion & compiler issues w/ some other compilers. Created 4 years, 4 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
Index: src/parsing/token.cc
diff --git a/src/parsing/token.cc b/src/parsing/token.cc
index 7edfefa82100c16a11db2773e18b4f3211e34ffd..45fd7b85314d206e818baf3c7b2241a14f955ad0 100644
--- a/src/parsing/token.cc
+++ b/src/parsing/token.cc
@@ -22,6 +22,10 @@ const char* const Token::string_[NUM_TOKENS] = {
};
#undef T
+constexpr uint8_t length(const char* str) { return str ? strlen(str) : 0; }
+#define T(name, string, precedence) length(string),
+const uint8_t Token::string_length_[NUM_TOKENS] = {TOKEN_LIST(T, T)};
+#undef T
#define T(name, string, precedence) precedence,
const int8_t Token::precedence_[NUM_TOKENS] = {
« src/parsing/scanner.cc ('K') | « src/parsing/token.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698