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

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: Feedback fix compiler issues. 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
« no previous file with comments | « src/parsing/token.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/token.cc
diff --git a/src/parsing/token.cc b/src/parsing/token.cc
index 7edfefa82100c16a11db2773e18b4f3211e34ffd..35038ba766d67d352b4d8d67a59ca01d676c6129 100644
--- a/src/parsing/token.cc
+++ b/src/parsing/token.cc
@@ -22,6 +22,16 @@ const char* const Token::string_[NUM_TOKENS] = {
};
#undef T
+#if !V8_CC_MSVC
+// TODO(vogelheim): Remove #if once MSVC supports constexpr on functions.
+constexpr
+#endif
+uint8_t length(const char* str) {
+ return str ? static_cast<uint8_t>(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] = {
« no previous file with comments | « 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