| 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 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 MessageKind.CANNOT_RESOLVE, [name]); | 2791 MessageKind.CANNOT_RESOLVE, [name]); |
| 2792 } else if (e.kind === ElementKind.TYPEDEF) { | 2792 } else if (e.kind === ElementKind.TYPEDEF) { |
| 2793 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]); | 2793 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]); |
| 2794 } else if (e.kind !== ElementKind.CLASS && e.kind !== ElementKind.PREFIX) { | 2794 } else if (e.kind !== ElementKind.CLASS && e.kind !== ElementKind.PREFIX) { |
| 2795 error(node, MessageKind.NOT_A_TYPE, [name]); | 2795 error(node, MessageKind.NOT_A_TYPE, [name]); |
| 2796 } | 2796 } |
| 2797 return e; | 2797 return e; |
| 2798 } | 2798 } |
| 2799 } | 2799 } |
| 2800 | 2800 |
| 2801 class Scope { | 2801 abstract class Scope { |
| 2802 final Element element; | 2802 final Element element; |
| 2803 final Scope parent; | 2803 final Scope parent; |
| 2804 | 2804 |
| 2805 Scope(this.parent, this.element); | 2805 Scope(this.parent, this.element); |
| 2806 abstract Element add(Element element); | 2806 abstract Element add(Element element); |
| 2807 | 2807 |
| 2808 Element lookup(SourceString name) { | 2808 Element lookup(SourceString name) { |
| 2809 Element result = localLookup(name); | 2809 Element result = localLookup(name); |
| 2810 if (result != null) return result; | 2810 if (result != null) return result; |
| 2811 return parent.lookup(name); | 2811 return parent.lookup(name); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 return result; | 3055 return result; |
| 3056 } | 3056 } |
| 3057 Element lookup(SourceString name) => localLookup(name); | 3057 Element lookup(SourceString name) => localLookup(name); |
| 3058 Element lexicalLookup(SourceString name) => localLookup(name); | 3058 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3059 | 3059 |
| 3060 Element add(Element newElement) { | 3060 Element add(Element newElement) { |
| 3061 throw "Cannot add an element in a patch library scope"; | 3061 throw "Cannot add an element in a patch library scope"; |
| 3062 } | 3062 } |
| 3063 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3063 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3064 } | 3064 } |
| OLD | NEW |