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

Unified Diff: src/parsing/token.h

Issue 1678303002: [es7] implement exponentiation operator proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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.h
diff --git a/src/parsing/token.h b/src/parsing/token.h
index 7a62b4d9153a399ac546df9496ed5d921d863ed3..fae9ea8bffb7f07feff5fe25fd851a79631e7a38 100644
--- a/src/parsing/token.h
+++ b/src/parsing/token.h
@@ -63,6 +63,7 @@ namespace internal {
T(ASSIGN_MUL, "*=", 2) \
T(ASSIGN_DIV, "/=", 2) \
T(ASSIGN_MOD, "%=", 2) \
+ T(ASSIGN_EXP, "**=", 2) \
\
/* Binary operators sorted by precedence. */ \
/* IsBinaryOp() relies on this block of enum values */ \
@@ -82,6 +83,7 @@ namespace internal {
T(MUL, "*", 13) \
T(DIV, "/", 13) \
T(MOD, "%", 13) \
+ T(EXP, "**", 14) \
\
/* Compare operators sorted by precedence. */ \
/* IsCompareOp() relies on this block of enum values */ \
@@ -214,12 +216,10 @@ class Token {
}
static bool IsAssignmentOp(Value tok) {
- return INIT <= tok && tok <= ASSIGN_MOD;
+ return INIT <= tok && tok <= ASSIGN_EXP;
}
- static bool IsBinaryOp(Value op) {
- return COMMA <= op && op <= MOD;
- }
+ static bool IsBinaryOp(Value op) { return COMMA <= op && op <= EXP; }
static bool IsTruncatingBinaryOp(Value op) {
return BIT_OR <= op && op <= ROR;

Powered by Google App Engine
This is Rietveld 408576698