| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 } | 8 } |
| 9 | 9 |
| 10 class TreeElementMapping implements TreeElements { | 10 class TreeElementMapping implements TreeElements { |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 // fields they reference are visible, but must be resolved independently. | 665 // fields they reference are visible, but must be resolved independently. |
| 666 if (element.kind == ElementKind.FIELD_PARAMETER) { | 666 if (element.kind == ElementKind.FIELD_PARAMETER) { |
| 667 useElement(parameterNode, element); | 667 useElement(parameterNode, element); |
| 668 } else { | 668 } else { |
| 669 defineElement(variableDefinitions.definitions.nodes.head, element); | 669 defineElement(variableDefinitions.definitions.nodes.head, element); |
| 670 } | 670 } |
| 671 parameterNodes = parameterNodes.tail; | 671 parameterNodes = parameterNodes.tail; |
| 672 }); | 672 }); |
| 673 } | 673 } |
| 674 | 674 |
| 675 visitCascade(Cascade node) { |
| 676 visit(node.expression); |
| 677 } |
| 678 |
| 679 visitCascadeReceiver(CascadeReceiver node) { |
| 680 visit(node.expression); |
| 681 } |
| 682 |
| 675 Element visitClassNode(ClassNode node) { | 683 Element visitClassNode(ClassNode node) { |
| 676 cancel(node, "shouldn't be called"); | 684 cancel(node, "shouldn't be called"); |
| 677 } | 685 } |
| 678 | 686 |
| 679 visitIn(Node node, Scope scope) { | 687 visitIn(Node node, Scope scope) { |
| 680 context = scope; | 688 context = scope; |
| 681 Element element = visit(node); | 689 Element element = visit(node); |
| 682 context = context.parent; | 690 context = context.parent; |
| 683 return element; | 691 return element; |
| 684 } | 692 } |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 | 1800 |
| 1793 TopScope(LibraryElement library) : super(null, library); | 1801 TopScope(LibraryElement library) : super(null, library); |
| 1794 Element lookup(SourceString name) { | 1802 Element lookup(SourceString name) { |
| 1795 return library.find(name); | 1803 return library.find(name); |
| 1796 } | 1804 } |
| 1797 | 1805 |
| 1798 Element add(Element element) { | 1806 Element add(Element element) { |
| 1799 throw "Cannot add an element in the top scope"; | 1807 throw "Cannot add an element in the top scope"; |
| 1800 } | 1808 } |
| 1801 } | 1809 } |
| OLD | NEW |