| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('elements'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 str = 'lt'; | 1503 str = 'lt'; |
| 1504 } else if (str === '&' || str === '&=') { | 1504 } else if (str === '&' || str === '&=') { |
| 1505 str = 'and'; | 1505 str = 'and'; |
| 1506 } else if (str === '^' || str === '^=') { | 1506 } else if (str === '^' || str === '^=') { |
| 1507 str = 'xor'; | 1507 str = 'xor'; |
| 1508 } else if (str === '|' || str === '|=') { | 1508 } else if (str === '|' || str === '|=') { |
| 1509 str = 'or'; | 1509 str = 'or'; |
| 1510 } else if (selector == const SourceString('negate')) { | 1510 } else if (selector == const SourceString('negate')) { |
| 1511 // TODO(ahe): Remove this case: Legacy support for pre-0.11 spec. | 1511 // TODO(ahe): Remove this case: Legacy support for pre-0.11 spec. |
| 1512 return selector; | 1512 return selector; |
| 1513 } else if (str === '?') { |
| 1514 return selector; |
| 1513 } else { | 1515 } else { |
| 1514 throw new Exception('Unhandled selector: ${selector.slowToString()}'); | 1516 throw new Exception('Unhandled selector: ${selector.slowToString()}'); |
| 1515 } | 1517 } |
| 1516 return new SourceString('operator\$$str'); | 1518 return new SourceString('operator\$$str'); |
| 1517 } | 1519 } |
| 1518 | 1520 |
| 1519 static bool isStringSupertype(Element element, Compiler compiler) { | 1521 static bool isStringSupertype(Element element, Compiler compiler) { |
| 1520 LibraryElement coreLibrary = compiler.coreLibrary; | 1522 LibraryElement coreLibrary = compiler.coreLibrary; |
| 1521 return (element == coreLibrary.find(const SourceString('Comparable'))) | 1523 return (element == coreLibrary.find(const SourceString('Comparable'))) |
| 1522 || (element == coreLibrary.find(const SourceString('Hashable'))) | 1524 || (element == coreLibrary.find(const SourceString('Hashable'))) |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 | 1651 |
| 1650 MetadataAnnotation ensureResolved(Compiler compiler) { | 1652 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1651 if (resolutionState == STATE_NOT_STARTED) { | 1653 if (resolutionState == STATE_NOT_STARTED) { |
| 1652 compiler.resolver.resolveMetadataAnnotation(this); | 1654 compiler.resolver.resolveMetadataAnnotation(this); |
| 1653 } | 1655 } |
| 1654 return this; | 1656 return this; |
| 1655 } | 1657 } |
| 1656 | 1658 |
| 1657 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1659 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1658 } | 1660 } |
| OLD | NEW |