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

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

Issue 10830253: Support for new operator - (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/parser.cc ('k') | tests/co19/co19-runtime.status » ('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) 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 static int Precedence(Kind tok) { 251 static int Precedence(Kind tok) {
252 ASSERT(tok < kNumTokens); 252 ASSERT(tok < kNumTokens);
253 return precedence_[tok]; 253 return precedence_[tok];
254 } 254 }
255 255
256 static Attribute Attributes(Kind tok) { 256 static Attribute Attributes(Kind tok) {
257 ASSERT(tok < kNumTokens); 257 ASSERT(tok < kNumTokens);
258 return attributes_[tok]; 258 return attributes_[tok];
259 } 259 }
260 260
261 // TODO(hausner): Remove the pseudo keyword 'negate' when old operator
262 // syntax for unary - is removed.
261 static bool CanBeOverloaded(Kind tok) { 263 static bool CanBeOverloaded(Kind tok) {
262 ASSERT(tok < kNumTokens); 264 ASSERT(tok < kNumTokens);
263 return IsRelationalOperator(tok) || 265 return IsRelationalOperator(tok) ||
264 (tok == kEQ) || 266 (tok == kEQ) ||
265 (tok >= kADD && tok <= kMOD) || // Arithmetic operations. 267 (tok >= kADD && tok <= kMOD) || // Arithmetic operations.
266 (tok >= kBIT_OR && tok <= kSHR) || // Bit operations. 268 (tok >= kBIT_OR && tok <= kSHR) || // Bit operations.
267 (tok == kINDEX) || 269 (tok == kINDEX) ||
268 (tok == kASSIGN_INDEX) || 270 (tok == kASSIGN_INDEX) ||
269 (tok == kNEGATE); 271 (tok == kNEGATE);
270 } 272 }
(...skipping 14 matching lines...) Expand all
285 static const char* name_[]; 287 static const char* name_[];
286 static const char* tok_str_[]; 288 static const char* tok_str_[];
287 static const uint8_t precedence_[]; 289 static const uint8_t precedence_[];
288 static const Attribute attributes_[]; 290 static const Attribute attributes_[];
289 }; 291 };
290 292
291 293
292 } // namespace dart 294 } // namespace dart
293 295
294 #endif // VM_TOKEN_H_ 296 #endif // VM_TOKEN_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698