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

Side by Side Diff: runtime/vm/token.cc

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 unified diff | Download patch
« no previous file with comments | « runtime/vm/token.h ('k') | runtime/vm/token_position.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/token.h" 5 #include "vm/token.h"
6 6
7 #include "vm/object.h" 7 #include "vm/object.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 #define TOKEN_NAME(t, s, p, a) #t, 11 #define TOKEN_NAME(t, s, p, a) #t,
12 const char* Token::name_[] = { 12 const char* Token::name_[] = {DART_TOKEN_LIST(TOKEN_NAME)
13 DART_TOKEN_LIST(TOKEN_NAME) 13 DART_KEYWORD_LIST(TOKEN_NAME)};
14 DART_KEYWORD_LIST(TOKEN_NAME)
15 };
16 #undef TOKEN_NAME 14 #undef TOKEN_NAME
17 15
18 #define TOKEN_STRING(t, s, p, a) s, 16 #define TOKEN_STRING(t, s, p, a) s,
19 const char* Token::tok_str_[] = { 17 const char* Token::tok_str_[] = {DART_TOKEN_LIST(TOKEN_STRING)
20 DART_TOKEN_LIST(TOKEN_STRING) 18 DART_KEYWORD_LIST(TOKEN_STRING)};
21 DART_KEYWORD_LIST(TOKEN_STRING)
22 };
23 #undef TOKEN_STRING 19 #undef TOKEN_STRING
24 20
25 #define TOKEN_PRECEDENCE(t, s, p, a) p, 21 #define TOKEN_PRECEDENCE(t, s, p, a) p,
26 const uint8_t Token::precedence_[] = { 22 const uint8_t Token::precedence_[] = {DART_TOKEN_LIST(TOKEN_PRECEDENCE)
27 DART_TOKEN_LIST(TOKEN_PRECEDENCE) 23 DART_KEYWORD_LIST(TOKEN_PRECEDENCE)};
28 DART_KEYWORD_LIST(TOKEN_PRECEDENCE)
29 };
30 #undef TOKEN_PRECEDENCE 24 #undef TOKEN_PRECEDENCE
31 25
32 #define TOKEN_ATTRIBUTE(t, s, p, a) a, 26 #define TOKEN_ATTRIBUTE(t, s, p, a) a,
33 const Token::Attribute Token::attributes_[] = { 27 const Token::Attribute Token::attributes_[] = {
34 DART_TOKEN_LIST(TOKEN_ATTRIBUTE) 28 DART_TOKEN_LIST(TOKEN_ATTRIBUTE) DART_KEYWORD_LIST(TOKEN_ATTRIBUTE)};
35 DART_KEYWORD_LIST(TOKEN_ATTRIBUTE)
36 };
37 #undef TOKEN_ATTRIBUTE 29 #undef TOKEN_ATTRIBUTE
38 30
39 31
40 bool Token::IsBinaryOperator(Token::Kind token) { 32 bool Token::IsBinaryOperator(Token::Kind token) {
41 switch (token) { 33 switch (token) {
42 case Token::kOR: 34 case Token::kOR:
43 case Token::kAND: 35 case Token::kAND:
44 return true; 36 return true;
45 default: 37 default:
46 return IsBinaryArithmeticOperator(token); 38 return IsBinaryArithmeticOperator(token);
(...skipping 24 matching lines...) Expand all
71 return false; 63 return false;
72 } 64 }
73 } 65 }
74 66
75 67
76 bool Token::IsUnaryArithmeticOperator(Token::Kind token) { 68 bool Token::IsUnaryArithmeticOperator(Token::Kind token) {
77 return (token == kBIT_NOT) || (token == kNEGATE); 69 return (token == kBIT_NOT) || (token == kNEGATE);
78 } 70 }
79 71
80 } // namespace dart 72 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/token.h ('k') | runtime/vm/token_position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698