| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.operators; | 5 library dart2js.operators; |
| 6 | 6 |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../universe/call_structure.dart' show CallStructure; | 8 import '../universe/call_structure.dart' show CallStructure; |
| 9 import '../universe/selector.dart' show Selector, SelectorKind; | 9 import '../universe/selector.dart' show Selector, SelectorKind; |
| 10 | 10 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 case '&=': | 420 case '&=': |
| 421 return AND; | 421 return AND; |
| 422 case '^=': | 422 case '^=': |
| 423 return XOR; | 423 return XOR; |
| 424 case '|=': | 424 case '|=': |
| 425 return OR; | 425 return OR; |
| 426 default: | 426 default: |
| 427 return null; | 427 return null; |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 |
| 431 static AssignmentOperator fromKind(AssignmentOperatorKind kind) { |
| 432 switch (kind) { |
| 433 case AssignmentOperatorKind.ASSIGN: return ASSIGN; |
| 434 case AssignmentOperatorKind.IF_NULL: return IF_NULL; |
| 435 case AssignmentOperatorKind.ADD: return ADD; |
| 436 case AssignmentOperatorKind.SUB: return SUB; |
| 437 case AssignmentOperatorKind.MUL: return MUL; |
| 438 case AssignmentOperatorKind.DIV: return DIV; |
| 439 case AssignmentOperatorKind.IDIV: return IDIV; |
| 440 case AssignmentOperatorKind.MOD: return MOD; |
| 441 case AssignmentOperatorKind.SHL: return SHL; |
| 442 case AssignmentOperatorKind.SHR: return SHR; |
| 443 case AssignmentOperatorKind.AND: return AND; |
| 444 case AssignmentOperatorKind.OR: return OR; |
| 445 case AssignmentOperatorKind.XOR: return XOR; |
| 446 } |
| 447 } |
| 430 } | 448 } |
| 431 | 449 |
| 432 enum IncDecOperatorKind { INC, DEC } | 450 enum IncDecOperatorKind { INC, DEC } |
| 433 | 451 |
| 434 class IncDecOperator { | 452 class IncDecOperator { |
| 435 final IncDecOperatorKind kind; | 453 final IncDecOperatorKind kind; |
| 436 final String name; | 454 final String name; |
| 437 final BinaryOperator binaryOperator; | 455 final BinaryOperator binaryOperator; |
| 438 | 456 |
| 439 const IncDecOperator._(this.kind, this.name, this.binaryOperator); | 457 const IncDecOperator._(this.kind, this.name, this.binaryOperator); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 453 static IncDecOperator parse(String value) { | 471 static IncDecOperator parse(String value) { |
| 454 switch (value) { | 472 switch (value) { |
| 455 case '++': | 473 case '++': |
| 456 return INC; | 474 return INC; |
| 457 case '--': | 475 case '--': |
| 458 return DEC; | 476 return DEC; |
| 459 default: | 477 default: |
| 460 return null; | 478 return null; |
| 461 } | 479 } |
| 462 } | 480 } |
| 481 |
| 482 static IncDecOperator fromKind(IncDecOperatorKind kind) { |
| 483 switch (kind) { |
| 484 case IncDecOperatorKind.INC: return INC; |
| 485 case IncDecOperatorKind.DEC: return DEC; |
| 486 } |
| 487 } |
| 463 } | 488 } |
| OLD | NEW |