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

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, 10 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..2f9cada0b8bdca4854d70c329ea916939526c14c 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 */ \
@@ -171,7 +173,6 @@ namespace internal {
T(TEMPLATE_SPAN, NULL, 0) \
T(TEMPLATE_TAIL, NULL, 0)
-
Dan Ehrenberg 2016/02/11 08:16:50 Why a change here?
class Token {
public:
// All token values.
@@ -214,12 +215,10 @@ class Token {
}
static bool IsAssignmentOp(Value tok) {
- return INIT <= tok && tok <= ASSIGN_MOD;
+ return INIT <= tok && tok <= ASSIGN_EXP;
Dan Ehrenberg 2016/02/11 08:16:50 Maybe make constants expressing the start and end?
}
- 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