Chromium Code Reviews| 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 #library('elements'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('../tree/tree.dart'); | 7 #import('../tree/tree.dart'); |
| 8 #import('../scanner/scannerlib.dart'); | 8 #import('../scanner/scannerlib.dart'); |
| 9 #import('../leg.dart'); // TODO(karlklose): we only need type. | 9 #import('../leg.dart'); // TODO(karlklose): we only need type. |
| 10 #import('../util/util.dart'); | 10 #import('../util/util.dart'); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 listener.cancel('duplicate definition', token: element.position()); | 298 listener.cancel('duplicate definition', token: element.position()); |
| 299 listener.cancel('existing definition', token: existing.position()); | 299 listener.cancel('existing definition', token: existing.position()); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 Element find(SourceString elementName) { | 304 Element find(SourceString elementName) { |
| 305 return elements[elementName]; | 305 return elements[elementName]; |
| 306 } | 306 } |
| 307 | 307 |
| 308 Element findLocal(SourceString elementName) { | |
|
floitsch
2012/05/01 14:37:44
add /**doc*/ for [findLocal] and [find].
| |
| 309 Element result = elements[elementName]; | |
| 310 if (result === null || result.getLibrary() != this) return null; | |
| 311 return result; | |
| 312 } | |
| 313 | |
| 308 void forEachExport(f(Element element)) { | 314 void forEachExport(f(Element element)) { |
| 309 elements.forEach((SourceString _, Element e) { | 315 elements.forEach((SourceString _, Element e) { |
| 310 if (this === e.getLibrary() | 316 if (this === e.getLibrary() |
| 311 && e.kind !== ElementKind.PREFIX | 317 && e.kind !== ElementKind.PREFIX |
| 312 && e.kind !== ElementKind.FOREIGN) { | 318 && e.kind !== ElementKind.FOREIGN) { |
| 313 if (!e.name.isPrivate()) f(e); | 319 if (!e.name.isPrivate()) f(e); |
| 314 } | 320 } |
| 315 }); | 321 }); |
| 316 } | 322 } |
| 317 | 323 |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1046 final Node node; | 1052 final Node node; |
| 1047 Type bound; | 1053 Type bound; |
| 1048 Type type; | 1054 Type type; |
| 1049 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1055 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1050 [this.bound]) | 1056 [this.bound]) |
| 1051 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1057 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1052 Type computeType(compiler) => type; | 1058 Type computeType(compiler) => type; |
| 1053 Node parseNode(compiler) => node; | 1059 Node parseNode(compiler) => node; |
| 1054 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1060 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1055 } | 1061 } |
| OLD | NEW |