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

Unified Diff: src/parsing/token.h

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/scanner.cc ('k') | src/parsing/token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/token.h
diff --git a/src/parsing/token.h b/src/parsing/token.h
index 8b44cda1788880fcb7921a50e3c19a2a8117e62c..3c446641c4bd1a404dc7ade4ae0eed12266e8a40 100644
--- a/src/parsing/token.h
+++ b/src/parsing/token.h
@@ -171,6 +171,7 @@ namespace internal {
/* Scanner-internal use only. */ \
T(WHITESPACE, NULL, 0) \
T(UNINITIALIZED, NULL, 0) \
+ T(REGEXP_LITERAL, NULL, 0) \
\
/* ES6 Template Literals */ \
T(TEMPLATE_SPAN, NULL, 0) \
@@ -325,6 +326,11 @@ class Token {
return string_[tok];
}
+ static uint8_t StringLength(Value tok) {
+ DCHECK(tok < NUM_TOKENS);
+ return string_length_[tok];
+ }
+
// Returns the precedence > 0 for binary and compare
// operators; returns 0 otherwise.
static int Precedence(Value tok) {
@@ -335,6 +341,7 @@ class Token {
private:
static const char* const name_[NUM_TOKENS];
static const char* const string_[NUM_TOKENS];
+ static const uint8_t string_length_[NUM_TOKENS];
static const int8_t precedence_[NUM_TOKENS];
static const char token_type[NUM_TOKENS];
};
« no previous file with comments | « src/parsing/scanner.cc ('k') | src/parsing/token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698