| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 ClassElement getEnclosingClass() { | 174 ClassElement getEnclosingClass() { |
| 175 for (Element e = this; e !== null; e = e.enclosingElement) { | 175 for (Element e = this; e !== null; e = e.enclosingElement) { |
| 176 if (e.kind === ElementKind.CLASS) return e; | 176 if (e.kind === ElementKind.CLASS) return e; |
| 177 } | 177 } |
| 178 return null; | 178 return null; |
| 179 } | 179 } |
| 180 | 180 |
| 181 toString() => '$kind(${name.slowToString()})'; | 181 toString() => '$kind(${name.slowToString()})'; |
| 182 | 182 |
| 183 bool _isNative = false; | 183 bool _isNative = false; |
| 184 void setNative() => _isNative = true; | 184 void setNative() { _isNative = true; } |
| 185 bool isNative() => _isNative; | 185 bool isNative() => _isNative; |
| 186 } | 186 } |
| 187 | 187 |
| 188 class ContainerElement extends Element { | 188 class ContainerElement extends Element { |
| 189 ContainerElement(name, kind, enclosingElement) : | 189 ContainerElement(name, kind, enclosingElement) : |
| 190 super(name, kind, enclosingElement); | 190 super(name, kind, enclosingElement); |
| 191 | 191 |
| 192 abstract void addMember(Element element, DiagnosticListener listener); | 192 abstract void addMember(Element element, DiagnosticListener listener); |
| 193 | 193 |
| 194 void addGetterOrSetter(Element element, | 194 void addGetterOrSetter(Element element, |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 final Node node; | 1016 final Node node; |
| 1017 Type bound; | 1017 Type bound; |
| 1018 Type type; | 1018 Type type; |
| 1019 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1019 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1020 [this.bound]) | 1020 [this.bound]) |
| 1021 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1021 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1022 Type computeType(compiler) => type; | 1022 Type computeType(compiler) => type; |
| 1023 Node parseNode(compiler) => node; | 1023 Node parseNode(compiler) => node; |
| 1024 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1024 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1025 } | 1025 } |
| OLD | NEW |