| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import 'dart:collection' show LinkedHashMap; | 7 import 'dart:collection' show LinkedHashMap; |
| 8 | 8 |
| 9 import 'elements.dart'; | 9 import 'elements.dart'; |
| 10 import '../../compiler.dart' as api; | 10 import '../../compiler.dart' as api; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 | 175 |
| 176 Token position() => null; | 176 Token position() => null; |
| 177 | 177 |
| 178 Token findMyName(Token token) { | 178 Token findMyName(Token token) { |
| 179 // We search for the token that has the name of this element. | 179 // We search for the token that has the name of this element. |
| 180 // For constructors, that doesn't work because they may have | 180 // For constructors, that doesn't work because they may have |
| 181 // named formed out of multiple tokens (named constructors) so | 181 // named formed out of multiple tokens (named constructors) so |
| 182 // for those we search for the class name instead. | 182 // for those we search for the class name instead. |
| 183 String needle = isConstructor() ? enclosingElement.name : name; | 183 SourceString needle = isConstructor() ? enclosingElement.name : name; |
| 184 for (Token t = token; EOF_TOKEN != t.kind; t = t.next) { | 184 for (Token t = token; EOF_TOKEN != t.kind; t = t.next) { |
| 185 if (needle == t.value) return t; | 185 if (needle == t.value) return t; |
| 186 } | 186 } |
| 187 return token; | 187 return token; |
| 188 } | 188 } |
| 189 | 189 |
| 190 CompilationUnitElement getCompilationUnit() { | 190 CompilationUnitElement getCompilationUnit() { |
| 191 Element element = this; | 191 Element element = this; |
| 192 while (!element.isCompilationUnit()) { | 192 while (!element.isCompilationUnit()) { |
| 193 element = element.enclosingElement; | 193 element = element.enclosingElement; |
| (...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 | 2208 |
| 2209 MetadataAnnotation ensureResolved(Compiler compiler) { | 2209 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2210 if (resolutionState == STATE_NOT_STARTED) { | 2210 if (resolutionState == STATE_NOT_STARTED) { |
| 2211 compiler.resolver.resolveMetadataAnnotation(this); | 2211 compiler.resolver.resolveMetadataAnnotation(this); |
| 2212 } | 2212 } |
| 2213 return this; | 2213 return this; |
| 2214 } | 2214 } |
| 2215 | 2215 |
| 2216 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2216 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2217 } | 2217 } |
| OLD | NEW |