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

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

Issue 316633002: Speed up identifying keywords in scanner, by using extra table. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/symbols.cc ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_TOKEN_H_ 5 #ifndef VM_TOKEN_H_
6 #define VM_TOKEN_H_ 6 #define VM_TOKEN_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 #undef T 201 #undef T
202 202
203 enum Attribute { 203 enum Attribute {
204 kNoAttribute = 0, 204 kNoAttribute = 0,
205 kKeyword = 1 << 0, 205 kKeyword = 1 << 0,
206 kPseudoKeyword = 1 << 1, 206 kPseudoKeyword = 1 << 1,
207 }; 207 };
208 208
209 static const Kind kFirstKeyword = kABSTRACT; 209 static const Kind kFirstKeyword = kABSTRACT;
210 static const Kind kLastKeyword = kWITH; 210 static const Kind kLastKeyword = kWITH;
211 static const int numKeywords = kLastKeyword - kFirstKeyword + 1; 211 static const int kNumKeywords = kLastKeyword - kFirstKeyword + 1;
212 212
213 static bool IsAssignmentOperator(Kind tok) { 213 static bool IsAssignmentOperator(Kind tok) {
214 return kASSIGN <= tok && tok <= kASSIGN_MOD; 214 return kASSIGN <= tok && tok <= kASSIGN_MOD;
215 } 215 }
216 216
217 static bool IsRelationalOperator(Kind tok) { 217 static bool IsRelationalOperator(Kind tok) {
218 return kLT <= tok && tok <= kGTE; 218 return kLT <= tok && tok <= kGTE;
219 } 219 }
220 220
221 static bool IsEqualityOperator(Kind tok) { 221 static bool IsEqualityOperator(Kind tok) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 static const char* name_[]; 316 static const char* name_[];
317 static const char* tok_str_[]; 317 static const char* tok_str_[];
318 static const uint8_t precedence_[]; 318 static const uint8_t precedence_[];
319 static const Attribute attributes_[]; 319 static const Attribute attributes_[];
320 }; 320 };
321 321
322 322
323 } // namespace dart 323 } // namespace dart
324 324
325 #endif // VM_TOKEN_H_ 325 #endif // VM_TOKEN_H_
OLDNEW
« no previous file with comments | « runtime/vm/symbols.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698