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

Side by Side Diff: dart/lib/compiler/implementation/scanner/token.dart

Issue 10870066: Support unary - operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix unparser to handle that negate is no longer a keyword. Created 8 years, 3 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
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 const int EOF_TOKEN = 0; 5 const int EOF_TOKEN = 0;
6 6
7 const int KEYWORD_TOKEN = $k; 7 const int KEYWORD_TOKEN = $k;
8 const int IDENTIFIER_TOKEN = $a; 8 const int IDENTIFIER_TOKEN = $a;
9 const int DOUBLE_TOKEN = $d; 9 const int DOUBLE_TOKEN = $d;
10 const int INT_TOKEN = $i; 10 const int INT_TOKEN = $i;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 class BeginGroupToken extends StringToken { 249 class BeginGroupToken extends StringToken {
250 Token endGroup; 250 Token endGroup;
251 BeginGroupToken(PrecedenceInfo info, String value, int charOffset) 251 BeginGroupToken(PrecedenceInfo info, String value, int charOffset)
252 : super(info, value, charOffset); 252 : super(info, value, charOffset);
253 } 253 }
254 254
255 bool isUserDefinableOperator(String value) { 255 bool isUserDefinableOperator(String value) {
256 return 256 return
257 (value === '==') || 257 (value === '==') ||
258 (value === '~') || 258 (value === '~') ||
259 (value === 'negate') ||
260 (value === '[]') || 259 (value === '[]') ||
261 (value === '[]=') || 260 (value === '[]=') ||
262 (value === '*') || 261 (value === '*') ||
263 (value === '/') || 262 (value === '/') ||
264 (value === '%') || 263 (value === '%') ||
265 (value === '~/') || 264 (value === '~/') ||
266 (value === '+') || 265 (value === '+') ||
267 (value === '-') || 266 (value === '-') ||
268 (value === '<<') || 267 (value === '<<') ||
269 (value === '>>>') || 268 (value === '>>>') ||
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 494
496 const PrecedenceInfo HEXADECIMAL_INFO = 495 const PrecedenceInfo HEXADECIMAL_INFO =
497 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); 496 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN);
498 497
499 const PrecedenceInfo COMMENT_INFO = 498 const PrecedenceInfo COMMENT_INFO =
500 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); 499 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN);
501 500
502 // For reporting lexical errors. 501 // For reporting lexical errors.
503 const PrecedenceInfo ERROR_INFO = 502 const PrecedenceInfo ERROR_INFO =
504 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); 503 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN);
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/scanner/parser.dart ('k') | dart/lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698