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

Unified Diff: runtime/vm/token.h

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 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 | « runtime/vm/timer.cc ('k') | runtime/vm/token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/token.h
diff --git a/runtime/vm/token.h b/runtime/vm/token.h
index 0f5ff542d88873c99a5c109409521a9cd39c010a..807e12c1c17c863896a2775b3ec06775180b195c 100644
--- a/runtime/vm/token.h
+++ b/runtime/vm/token.h
@@ -42,12 +42,12 @@ namespace dart {
TOK(kLBRACE, "{", 0, kNoAttribute) \
TOK(kRBRACE, "}", 0, kNoAttribute) \
TOK(kARROW, "=>", 0, kNoAttribute) \
- TOK(kCOLON, ":", 0, kNoAttribute) \
+ TOK(kCOLON, ":", 0, kNoAttribute) \
TOK(kSEMICOLON, ";", 0, kNoAttribute) \
TOK(kPERIOD, ".", 0, kNoAttribute) \
TOK(kQM_PERIOD, "?.", 0, kNoAttribute) \
- TOK(kINCR, "++", 0, kNoAttribute) \
- TOK(kDECR, "--", 0, kNoAttribute) \
+ TOK(kINCR, "++", 0, kNoAttribute) \
+ TOK(kDECR, "--", 0, kNoAttribute) \
\
/* Assignment operators. */ \
/* Please update IsAssignmentOperator() if you make */ \
@@ -139,7 +139,7 @@ namespace dart {
TOK(kSCRIPTTAG, "#!", 0, kNoAttribute) \
\
/* Support for optimized code */ \
- TOK(kREM, "", 0, kNoAttribute) \
+ TOK(kREM, "", 0, kNoAttribute)
// List of keywords. The list must be alphabetically ordered. The
// keyword recognition code depends on the ordering.
@@ -199,17 +199,13 @@ class String;
class Token {
public:
#define T(t, s, p, a) t,
- enum Kind {
- DART_TOKEN_LIST(T)
- DART_KEYWORD_LIST(T)
- kNumTokens
- };
+ enum Kind { DART_TOKEN_LIST(T) DART_KEYWORD_LIST(T) kNumTokens };
#undef T
enum Attribute {
- kNoAttribute = 0,
- kKeyword = 1 << 0,
- kPseudoKeyword = 1 << 1,
+ kNoAttribute = 0,
+ kKeyword = 1 << 0,
+ kPseudoKeyword = 1 << 1,
};
static const Kind kFirstKeyword = kABSTRACT;
@@ -236,9 +232,7 @@ class Token {
return (tok == kIS) || (tok == kISNOT);
}
- static bool IsTypeCastOperator(Kind tok) {
- return tok == kAS;
- }
+ static bool IsTypeCastOperator(Kind tok) { return tok == kAS; }
static bool IsIndexOperator(Kind tok) {
return tok == kINDEX || tok == kASSIGN_INDEX;
@@ -248,9 +242,7 @@ class Token {
return (Attributes(tok) & kPseudoKeyword) != 0;
}
- static bool IsKeyword(Kind tok) {
- return (Attributes(tok) & kKeyword) != 0;
- }
+ static bool IsKeyword(Kind tok) { return (Attributes(tok) & kKeyword) != 0; }
static bool IsIdentifier(Kind tok) {
return (tok == kIDENT) || IsPseudoKeyword(tok);
@@ -278,20 +270,16 @@ class Token {
static bool CanBeOverloaded(Kind tok) {
ASSERT(tok < kNumTokens);
- return IsRelationalOperator(tok) ||
- (tok == kEQ) ||
- (tok >= kADD && tok <= kMOD) || // Arithmetic operations.
+ return IsRelationalOperator(tok) || (tok == kEQ) ||
+ (tok >= kADD && tok <= kMOD) || // Arithmetic operations.
(tok >= kBIT_OR && tok <= kSHR) || // Bit operations.
- (tok == kINDEX) ||
- (tok == kASSIGN_INDEX);
+ (tok == kINDEX) || (tok == kASSIGN_INDEX);
}
static bool NeedsLiteralToken(Kind tok) {
ASSERT(tok < kNumTokens);
- return ((tok == Token::kINTEGER) ||
- (tok == Token::kSTRING) ||
- (tok == Token::kINTERPOL_VAR) ||
- (tok == Token::kERROR) ||
+ return ((tok == Token::kINTEGER) || (tok == Token::kSTRING) ||
+ (tok == Token::kINTERPOL_VAR) || (tok == Token::kERROR) ||
(tok == Token::kDOUBLE));
}
@@ -305,16 +293,26 @@ class Token {
// !(a (op) b) === a (op') b
static Token::Kind NegateComparison(Token::Kind op) {
switch (op) {
- case Token::kEQ: return Token::kNE;
- case Token::kNE: return Token::kEQ;
- case Token::kLT: return Token::kGTE;
- case Token::kGT: return Token::kLTE;
- case Token::kLTE: return Token::kGT;
- case Token::kGTE: return Token::kLT;
- case Token::kEQ_STRICT: return Token::kNE_STRICT;
- case Token::kNE_STRICT: return Token::kEQ_STRICT;
- case Token::kIS: return Token::kISNOT;
- case Token::kISNOT: return Token::kIS;
+ case Token::kEQ:
+ return Token::kNE;
+ case Token::kNE:
+ return Token::kEQ;
+ case Token::kLT:
+ return Token::kGTE;
+ case Token::kGT:
+ return Token::kLTE;
+ case Token::kLTE:
+ return Token::kGT;
+ case Token::kGTE:
+ return Token::kLT;
+ case Token::kEQ_STRICT:
+ return Token::kNE_STRICT;
+ case Token::kNE_STRICT:
+ return Token::kEQ_STRICT;
+ case Token::kIS:
+ return Token::kISNOT;
+ case Token::kISNOT:
+ return Token::kIS;
default:
UNREACHABLE();
return Token::kILLEGAL;
« no previous file with comments | « runtime/vm/timer.cc ('k') | runtime/vm/token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698