| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 LibraryElement getLibrary() { | 101 LibraryElement getLibrary() { |
| 102 Element element = this; | 102 Element element = this; |
| 103 while (element.kind !== ElementKind.LIBRARY) { | 103 while (element.kind !== ElementKind.LIBRARY) { |
| 104 element = element.enclosingElement; | 104 element = element.enclosingElement; |
| 105 } | 105 } |
| 106 return element; | 106 return element; |
| 107 } | 107 } |
| 108 | 108 |
| 109 toString() => '$kind($name)'; | 109 toString() => '$kind(${name.slowToString()})'; |
| 110 } | 110 } |
| 111 | 111 |
| 112 class ContainerElement extends Element { | 112 class ContainerElement extends Element { |
| 113 ContainerElement(name, kind, enclosingElement) : | 113 ContainerElement(name, kind, enclosingElement) : |
| 114 super(name, kind, enclosingElement); | 114 super(name, kind, enclosingElement); |
| 115 | 115 |
| 116 abstract void addMember(Element element, DiagnosticListener listener); | 116 abstract void addMember(Element element, DiagnosticListener listener); |
| 117 } | 117 } |
| 118 | 118 |
| 119 class CompilationUnitElement extends ContainerElement { | 119 class CompilationUnitElement extends ContainerElement { |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 | 806 |
| 807 LabelElement addLabel(Identifier label, String labelName) { | 807 LabelElement addLabel(Identifier label, String labelName) { |
| 808 LabelElement result = new LabelElement(label, labelName, this, | 808 LabelElement result = new LabelElement(label, labelName, this, |
| 809 enclosingElement); | 809 enclosingElement); |
| 810 labels = labels.prepend(result); | 810 labels = labels.prepend(result); |
| 811 return result; | 811 return result; |
| 812 } | 812 } |
| 813 | 813 |
| 814 Node parseNode(DiagnosticListener l) => statement; | 814 Node parseNode(DiagnosticListener l) => statement; |
| 815 } | 815 } |
| OLD | NEW |