| 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 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 MessageKind.CANNOT_RESOLVE, [name]); | 2730 MessageKind.CANNOT_RESOLVE, [name]); |
| 2731 } else if (e.kind === ElementKind.TYPEDEF) { | 2731 } else if (e.kind === ElementKind.TYPEDEF) { |
| 2732 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]); | 2732 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]); |
| 2733 } else if (e.kind !== ElementKind.CLASS && e.kind !== ElementKind.PREFIX) { | 2733 } else if (e.kind !== ElementKind.CLASS && e.kind !== ElementKind.PREFIX) { |
| 2734 error(node, MessageKind.NOT_A_TYPE, [name]); | 2734 error(node, MessageKind.NOT_A_TYPE, [name]); |
| 2735 } | 2735 } |
| 2736 return e; | 2736 return e; |
| 2737 } | 2737 } |
| 2738 } | 2738 } |
| 2739 | 2739 |
| 2740 class Scope { | 2740 abstract class Scope { |
| 2741 final Element element; | 2741 final Element element; |
| 2742 final Scope parent; | 2742 final Scope parent; |
| 2743 | 2743 |
| 2744 Scope(this.parent, this.element); | 2744 Scope(this.parent, this.element); |
| 2745 abstract Element add(Element element); | 2745 abstract Element add(Element element); |
| 2746 | 2746 |
| 2747 Element lookup(SourceString name) { | 2747 Element lookup(SourceString name) { |
| 2748 Element result = localLookup(name); | 2748 Element result = localLookup(name); |
| 2749 if (result != null) return result; | 2749 if (result != null) return result; |
| 2750 return parent.lookup(name); | 2750 return parent.lookup(name); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2879 | 2879 |
| 2880 Element localLookup(SourceString name) => library.find(name); | 2880 Element localLookup(SourceString name) => library.find(name); |
| 2881 Element lookup(SourceString name) => localLookup(name); | 2881 Element lookup(SourceString name) => localLookup(name); |
| 2882 Element lexicalLookup(SourceString name) => localLookup(name); | 2882 Element lexicalLookup(SourceString name) => localLookup(name); |
| 2883 | 2883 |
| 2884 Element add(Element newElement) { | 2884 Element add(Element newElement) { |
| 2885 throw "Cannot add an element in the top scope"; | 2885 throw "Cannot add an element in the top scope"; |
| 2886 } | 2886 } |
| 2887 String toString() => '$element'; | 2887 String toString() => '$element'; |
| 2888 } | 2888 } |
| OLD | NEW |