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 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()) f(e); | |
|
ahe
2012/03/10 20:58:48
===
| |
| 282 }); | |
| 283 } | |
| 278 } | 284 } |
| 279 | 285 |
| 280 class PrefixElement extends Element { | 286 class PrefixElement extends Element { |
| 281 final LiteralString prefix; | 287 final LiteralString prefix; |
| 282 final LibraryElement library; | 288 final LibraryElement library; |
| 283 | 289 |
| 284 PrefixElement(LiteralString prefix, | 290 PrefixElement(LiteralString prefix, |
| 285 LibraryElement this.library, | 291 LibraryElement this.library, |
| 286 Element enclosing) | 292 Element enclosing) |
| 287 : this.prefix = prefix, | 293 : this.prefix = prefix, |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 840 | 846 |
| 841 LabelElement addLabel(Identifier label, String labelName) { | 847 LabelElement addLabel(Identifier label, String labelName) { |
| 842 LabelElement result = new LabelElement(label, labelName, this, | 848 LabelElement result = new LabelElement(label, labelName, this, |
| 843 enclosingElement); | 849 enclosingElement); |
| 844 labels = labels.prepend(result); | 850 labels = labels.prepend(result); |
| 845 return result; | 851 return result; |
| 846 } | 852 } |
| 847 | 853 |
| 848 Node parseNode(DiagnosticListener l) => statement; | 854 Node parseNode(DiagnosticListener l) => statement; |
| 849 } | 855 } |
| OLD | NEW |