| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 Element find(SourceString name) { | 269 Element find(SourceString name) { |
| 270 return elements[name]; | 270 return elements[name]; |
| 271 } | 271 } |
| 272 | 272 |
| 273 Element lookupLocalMember(SourceString name) { | 273 Element lookupLocalMember(SourceString name) { |
| 274 Element element = find(name); | 274 Element element = find(name); |
| 275 if (element === null) return null; | 275 if (element === null) return null; |
| 276 return (this === element.getLibrary()) ? element : null; | 276 return (this === element.getLibrary()) ? element : null; |
| 277 } | 277 } |
| 278 |
| 279 void forEachExport(f(Element element)) { |
| 280 elements.forEach((SourceString _, Element e) { |
| 281 if (this === e.getLibrary() |
| 282 && e.kind !== ElementKind.PREFIX |
| 283 && e.kind !== ElementKind.FOREIGN) { |
| 284 f(e); |
| 285 } |
| 286 }); |
| 287 } |
| 278 } | 288 } |
| 279 | 289 |
| 280 class PrefixElement extends Element { | 290 class PrefixElement extends Element { |
| 281 final LiteralString prefix; | 291 final LiteralString prefix; |
| 282 final LibraryElement library; | 292 final LibraryElement library; |
| 283 | 293 |
| 284 PrefixElement(LiteralString prefix, | 294 PrefixElement(LiteralString prefix, |
| 285 LibraryElement this.library, | 295 LibraryElement this.library, |
| 286 Element enclosing) | 296 Element enclosing) |
| 287 : this.prefix = prefix, | 297 : this.prefix = prefix, |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 850 |
| 841 LabelElement addLabel(Identifier label, String labelName) { | 851 LabelElement addLabel(Identifier label, String labelName) { |
| 842 LabelElement result = new LabelElement(label, labelName, this, | 852 LabelElement result = new LabelElement(label, labelName, this, |
| 843 enclosingElement); | 853 enclosingElement); |
| 844 labels = labels.prepend(result); | 854 labels = labels.prepend(result); |
| 845 return result; | 855 return result; |
| 846 } | 856 } |
| 847 | 857 |
| 848 Node parseNode(DiagnosticListener l) => statement; | 858 Node parseNode(DiagnosticListener l) => statement; |
| 849 } | 859 } |
| OLD | NEW |