| 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 abstract class TreeElements { | 5 abstract class TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 if (node.isIndex) { | 1587 if (node.isIndex) { |
| 1588 return isSet ? new Selector.indexSet() : new Selector.index(); | 1588 return isSet ? new Selector.indexSet() : new Selector.index(); |
| 1589 } | 1589 } |
| 1590 | 1590 |
| 1591 if (node.isOperator) { | 1591 if (node.isOperator) { |
| 1592 SourceString source = node.selector.asOperator().source; | 1592 SourceString source = node.selector.asOperator().source; |
| 1593 String string = source.stringValue; | 1593 String string = source.stringValue; |
| 1594 if (string === '!' || string === '&&' || string == '||' || | 1594 if (string === '!' || string === '&&' || string == '||' || |
| 1595 string === 'is' || string === 'as' || | 1595 string === 'is' || string === 'as' || |
| 1596 string === '===' || string === '!==' || | 1596 string === '===' || string === '!==' || |
| 1597 string === '?' || |
| 1597 string === '>>>') { | 1598 string === '>>>') { |
| 1598 return null; | 1599 return null; |
| 1599 } | 1600 } |
| 1601 if (!isUserDefinableOperator(source.stringValue)) { |
| 1602 source = Elements.mapToUserOperator(source); |
| 1603 } |
| 1600 return node.arguments.isEmpty() | 1604 return node.arguments.isEmpty() |
| 1601 ? new Selector.unaryOperator(source) | 1605 ? new Selector.unaryOperator(source) |
| 1602 : new Selector.binaryOperator(source); | 1606 : new Selector.binaryOperator(source); |
| 1603 } | 1607 } |
| 1604 | 1608 |
| 1605 Identifier identifier = node.selector.asIdentifier(); | 1609 Identifier identifier = node.selector.asIdentifier(); |
| 1606 if (node.isPropertyAccess) { | 1610 if (node.isPropertyAccess) { |
| 1607 assert(!isSet); | 1611 assert(!isSet); |
| 1608 return new Selector.getter(identifier.source, library); | 1612 return new Selector.getter(identifier.source, library); |
| 1609 } else if (isSet) { | 1613 } else if (isSet) { |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3227 return result; | 3231 return result; |
| 3228 } | 3232 } |
| 3229 Element lookup(SourceString name) => localLookup(name); | 3233 Element lookup(SourceString name) => localLookup(name); |
| 3230 Element lexicalLookup(SourceString name) => localLookup(name); | 3234 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3231 | 3235 |
| 3232 Element add(Element newElement) { | 3236 Element add(Element newElement) { |
| 3233 throw "Cannot add an element in a patch library scope"; | 3237 throw "Cannot add an element in a patch library scope"; |
| 3234 } | 3238 } |
| 3235 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3239 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3236 } | 3240 } |
| OLD | NEW |