| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 LibraryElement getLibrary() { | 94 LibraryElement getLibrary() { |
| 95 Element element = this; | 95 Element element = this; |
| 96 while (element.kind !== ElementKind.LIBRARY) { | 96 while (element.kind !== ElementKind.LIBRARY) { |
| 97 element = element.enclosingElement; | 97 element = element.enclosingElement; |
| 98 } | 98 } |
| 99 return element; | 99 return element; |
| 100 } | 100 } |
| 101 | 101 |
| 102 toString() => '$kind($name)'; | 102 toString() => '$kind(${name.slowToString()})'; |
| 103 } | 103 } |
| 104 | 104 |
| 105 class ContainerElement extends Element { | 105 class ContainerElement extends Element { |
| 106 ContainerElement(name, kind, enclosingElement) : | 106 ContainerElement(name, kind, enclosingElement) : |
| 107 super(name, kind, enclosingElement); | 107 super(name, kind, enclosingElement); |
| 108 | 108 |
| 109 abstract void addMember(Element element, DiagnosticListener listener); | 109 abstract void addMember(Element element, DiagnosticListener listener); |
| 110 } | 110 } |
| 111 | 111 |
| 112 class CompilationUnitElement extends ContainerElement { | 112 class CompilationUnitElement extends ContainerElement { |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 783 |
| 784 LabelElement addLabel(Identifier label, String labelName) { | 784 LabelElement addLabel(Identifier label, String labelName) { |
| 785 LabelElement result = new LabelElement(label, labelName, this, | 785 LabelElement result = new LabelElement(label, labelName, this, |
| 786 enclosingElement); | 786 enclosingElement); |
| 787 labels = labels.prepend(result); | 787 labels = labels.prepend(result); |
| 788 return result; | 788 return result; |
| 789 } | 789 } |
| 790 | 790 |
| 791 Node parseNode(DiagnosticListener l) => statement; | 791 Node parseNode(DiagnosticListener l) => statement; |
| 792 } | 792 } |
| OLD | NEW |