| 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 dart2js.tokens; | 5 library dart2js.tokens; |
| 6 | 6 |
| 7 import 'dart:convert' show | 7 import 'dart:convert' show |
| 8 UTF8; | 8 UTF8; |
| 9 import 'dart:collection' show | 9 import 'dart:collection' show |
| 10 HashSet; | 10 HashSet; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 409 } |
| 410 | 410 |
| 411 bool isUserDefinableOperator(String value) { | 411 bool isUserDefinableOperator(String value) { |
| 412 return | 412 return |
| 413 isBinaryOperator(value) || | 413 isBinaryOperator(value) || |
| 414 isMinusOperator(value) || | 414 isMinusOperator(value) || |
| 415 isTernaryOperator(value) || | 415 isTernaryOperator(value) || |
| 416 isUnaryOperator(value); | 416 isUnaryOperator(value); |
| 417 } | 417 } |
| 418 | 418 |
| 419 bool isUnaryOperator(String value) => identical(value, '~'); | 419 bool isUnaryOperator(String value) => value == '~'; |
| 420 | 420 |
| 421 bool isBinaryOperator(String value) { | 421 bool isBinaryOperator(String value) { |
| 422 return | 422 return |
| 423 (identical(value, '==')) || | 423 value == '==' || |
| 424 (identical(value, '[]')) || | 424 value == '[]' || |
| 425 (identical(value, '*')) || | 425 value == '*' || |
| 426 (identical(value, '/')) || | 426 value == '/' || |
| 427 (identical(value, '%')) || | 427 value == '%' || |
| 428 (identical(value, '~/')) || | 428 value == '~/' || |
| 429 (identical(value, '+')) || | 429 value == '+' || |
| 430 (identical(value, '<<')) || | 430 value == '<<' || |
| 431 (identical(value, '>>')) || | 431 value == '>>' || |
| 432 (identical(value, '>=')) || | 432 value == '>=' || |
| 433 (identical(value, '>')) || | 433 value == '>' || |
| 434 (identical(value, '<=')) || | 434 value == '<=' || |
| 435 (identical(value, '<')) || | 435 value == '<' || |
| 436 (identical(value, '&')) || | 436 value == '&' || |
| 437 (identical(value, '^')) || | 437 value == '^' || |
| 438 (identical(value, '|')); | 438 value == '|'; |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool isTernaryOperator(String value) => identical(value, '[]='); | 441 bool isTernaryOperator(String value) => value == '[]='; |
| 442 | 442 |
| 443 bool isMinusOperator(String value) => identical(value, '-'); | 443 bool isMinusOperator(String value) => value == '-'; |
| OLD | NEW |