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]; |
}; |