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