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

Unified Diff: src/parsing/token.h

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: merging with master Created 5 years, 1 month 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-character-streams.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 fee1f7e85aa3a02ef9b3aa56d666ce203a4166f9..a7395f05da9e8c523698f7fb2d95fc89eae02ce7 100644
--- a/src/parsing/token.h
+++ b/src/parsing/token.h
@@ -174,12 +174,9 @@ namespace internal {
class Token {
public:
- // All token values.
+// All token values.
#define T(name, string, precedence) name,
- enum Value {
- TOKEN_LIST(T, T)
- NUM_TOKENS
- };
+ enum Value { TOKEN_LIST(T, T) NUM_TOKENS };
#undef T
// Returns a string corresponding to the C++ token name
@@ -190,9 +187,7 @@ class Token {
}
// Predicates
- static bool IsKeyword(Value tok) {
- return token_type[tok] == 'K';
- }
+ static bool IsKeyword(Value tok) { return token_type[tok] == 'K'; }
static bool IsIdentifier(Value tok, LanguageMode language_mode,
bool is_generator) {
@@ -217,46 +212,46 @@ class Token {
return INIT <= tok && tok <= ASSIGN_MOD;
}
- static bool IsBinaryOp(Value op) {
- return COMMA <= op && op <= MOD;
- }
+ static bool IsBinaryOp(Value op) { return COMMA <= op && op <= MOD; }
static bool IsTruncatingBinaryOp(Value op) {
return BIT_OR <= op && op <= ROR;
}
- static bool IsCompareOp(Value op) {
- return EQ <= op && op <= IN;
- }
+ static bool IsCompareOp(Value op) { return EQ <= op && op <= IN; }
static bool IsOrderedRelationalCompareOp(Value op) {
return op == LT || op == LTE || op == GT || op == GTE;
}
- static bool IsEqualityOp(Value op) {
- return op == EQ || op == EQ_STRICT;
- }
+ static bool IsEqualityOp(Value op) { return op == EQ || op == EQ_STRICT; }
- static bool IsInequalityOp(Value op) {
- return op == NE || op == NE_STRICT;
- }
+ static bool IsInequalityOp(Value op) { return op == NE || op == NE_STRICT; }
static bool IsArithmeticCompareOp(Value op) {
- return IsOrderedRelationalCompareOp(op) ||
- IsEqualityOp(op) || IsInequalityOp(op);
+ return IsOrderedRelationalCompareOp(op) || IsEqualityOp(op) ||
+ IsInequalityOp(op);
}
static Value NegateCompareOp(Value op) {
DCHECK(IsArithmeticCompareOp(op));
switch (op) {
- case EQ: return NE;
- case NE: return EQ;
- case EQ_STRICT: return NE_STRICT;
- case NE_STRICT: return EQ_STRICT;
- case LT: return GTE;
- case GT: return LTE;
- case LTE: return GT;
- case GTE: return LT;
+ case EQ:
+ return NE;
+ case NE:
+ return EQ;
+ case EQ_STRICT:
+ return NE_STRICT;
+ case NE_STRICT:
+ return EQ_STRICT;
+ case LT:
+ return GTE;
+ case GT:
+ return LTE;
+ case LTE:
+ return GT;
+ case GTE:
+ return LT;
default:
UNREACHABLE();
return op;
@@ -266,14 +261,22 @@ class Token {
static Value ReverseCompareOp(Value op) {
DCHECK(IsArithmeticCompareOp(op));
switch (op) {
- case EQ: return EQ;
- case NE: return NE;
- case EQ_STRICT: return EQ_STRICT;
- case NE_STRICT: return NE_STRICT;
- case LT: return GT;
- case GT: return LT;
- case LTE: return GTE;
- case GTE: return LTE;
+ case EQ:
+ return EQ;
+ case NE:
+ return NE;
+ case EQ_STRICT:
+ return EQ_STRICT;
+ case NE_STRICT:
+ return NE_STRICT;
+ case LT:
+ return GT;
+ case GT:
+ return LT;
+ case LTE:
+ return GTE;
+ case GTE:
+ return LTE;
default:
UNREACHABLE();
return op;
@@ -288,13 +291,9 @@ class Token {
return (NOT <= op && op <= VOID) || op == ADD || op == SUB;
}
- static bool IsCountOp(Value op) {
- return op == INC || op == DEC;
- }
+ static bool IsCountOp(Value op) { return op == INC || op == DEC; }
- static bool IsShiftOp(Value op) {
- return (SHL <= op) && (op <= SHR);
- }
+ static bool IsShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
// Returns a string corresponding to the JS token string
// (.e., "<" for the token LT) or NULL if the token doesn't
« no previous file with comments | « src/parsing/scanner-character-streams.cc ('k') | src/parsing/token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698