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 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
9 } | 9 } |
10 | 10 |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 } | 1860 } |
1861 | 1861 |
1862 class VariableDefinitionsVisitor extends CommonResolverVisitor<SourceString> { | 1862 class VariableDefinitionsVisitor extends CommonResolverVisitor<SourceString> { |
1863 VariableDefinitions definitions; | 1863 VariableDefinitions definitions; |
1864 ResolverVisitor resolver; | 1864 ResolverVisitor resolver; |
1865 ElementKind kind; | 1865 ElementKind kind; |
1866 VariableListElement variables; | 1866 VariableListElement variables; |
1867 | 1867 |
1868 VariableDefinitionsVisitor(Compiler compiler, | 1868 VariableDefinitionsVisitor(Compiler compiler, |
1869 this.definitions, this.resolver, this.kind) | 1869 this.definitions, this.resolver, this.kind) |
1870 : super(compiler) { | 1870 : super(compiler) |
| 1871 { |
1871 variables = new VariableListElement.node( | 1872 variables = new VariableListElement.node( |
1872 definitions, ElementKind.VARIABLE_LIST, resolver.context.element); | 1873 definitions, ElementKind.VARIABLE_LIST, resolver.context.element); |
1873 } | 1874 } |
1874 | 1875 |
1875 SourceString visitSendSet(SendSet node) { | 1876 SourceString visitSendSet(SendSet node) { |
1876 assert(node.arguments.tail.isEmpty()); // Sanity check | 1877 assert(node.arguments.tail.isEmpty()); // Sanity check |
1877 resolver.visit(node.arguments.head); | 1878 resolver.visit(node.arguments.head); |
1878 return visit(node.selector); | 1879 return visit(node.selector); |
1879 } | 1880 } |
1880 | 1881 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 | 2205 |
2205 TopScope(LibraryElement library) : super(null, library); | 2206 TopScope(LibraryElement library) : super(null, library); |
2206 Element lookup(SourceString name) { | 2207 Element lookup(SourceString name) { |
2207 return library.find(name); | 2208 return library.find(name); |
2208 } | 2209 } |
2209 | 2210 |
2210 Element add(Element newElement) { | 2211 Element add(Element newElement) { |
2211 throw "Cannot add an element in the top scope"; | 2212 throw "Cannot add an element in the top scope"; |
2212 } | 2213 } |
2213 } | 2214 } |
OLD | NEW |