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

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/token.dart

Issue 2691213005: Use identical in token operators. (Closed)
Patch Set: Ensure operator names are canonicalized by deserializer. Created 3 years, 10 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('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) 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 library fasta.scanner.token; 5 library fasta.scanner.token;
6 6
7 import 'dart:collection' show 7 import 'dart:collection' show
8 HashSet; 8 HashSet;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 : super.internal(); 343 : super.internal();
344 } 344 }
345 345
346 bool isUserDefinableOperator(String value) { 346 bool isUserDefinableOperator(String value) {
347 return isBinaryOperator(value) || 347 return isBinaryOperator(value) ||
348 isMinusOperator(value) || 348 isMinusOperator(value) ||
349 isTernaryOperator(value) || 349 isTernaryOperator(value) ||
350 isUnaryOperator(value); 350 isUnaryOperator(value);
351 } 351 }
352 352
353 bool isUnaryOperator(String value) => value == '~'; 353 bool isUnaryOperator(String value) => identical(value, "~");
354 354
355 bool isBinaryOperator(String value) { 355 bool isBinaryOperator(String value) {
356 return value == '==' || 356 return identical(value, "==") ||
357 value == '[]' || 357 identical(value, "[]") ||
358 value == '*' || 358 identical(value, "*") ||
359 value == '/' || 359 identical(value, "/") ||
360 value == '%' || 360 identical(value, "%") ||
361 value == '~/' || 361 identical(value, "~/") ||
362 value == '+' || 362 identical(value, "+") ||
363 value == '<<' || 363 identical(value, "<<") ||
364 value == '>>' || 364 identical(value, ">>") ||
365 value == '>=' || 365 identical(value, ">=") ||
366 value == '>' || 366 identical(value, ">") ||
367 value == '<=' || 367 identical(value, "<=") ||
368 value == '<' || 368 identical(value, "<") ||
369 value == '&' || 369 identical(value, "&") ||
370 value == '^' || 370 identical(value, "^") ||
371 value == '|'; 371 identical(value, "|");
372 } 372 }
373 373
374 bool isTernaryOperator(String value) => value == '[]='; 374 bool isTernaryOperator(String value) => identical(value, "[]=");
375 375
376 bool isMinusOperator(String value) => value == '-'; 376 bool isMinusOperator(String value) => identical(value, "-");
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698