| OLD | NEW |
| 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 Loading... |
| 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, "-"); |
| OLD | NEW |