| 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('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 abstract class TypeDeclarationElement implements Element { | 1052 abstract class TypeDeclarationElement implements Element { |
| 1053 // TODO(johnniwinther): This class should eventually be a mixin. | 1053 // TODO(johnniwinther): This class should eventually be a mixin. |
| 1054 | 1054 |
| 1055 /** | 1055 /** |
| 1056 * The type variables declared on this declaration. The type variables are not | 1056 * The type variables declared on this declaration. The type variables are not |
| 1057 * available until the type of the element has been computed through | 1057 * available until the type of the element has been computed through |
| 1058 * [computeType]. | 1058 * [computeType]. |
| 1059 */ | 1059 */ |
| 1060 // TODO(johnniwinther): Find a (better) way to decouple [typeVariables] from | 1060 // TODO(johnniwinther): Find a (better) way to decouple [typeVariables] from |
| 1061 // [Compiler]. | 1061 // [Compiler]. |
| 1062 abstract Link<Type> get typeVariables(); | 1062 abstract Link<Type> get typeVariables; |
| 1063 | 1063 |
| 1064 /** | 1064 /** |
| 1065 * Creates the type variables, their type and corresponding element, for the | 1065 * Creates the type variables, their type and corresponding element, for the |
| 1066 * type variables declared in [parameter] on [element]. The bounds of the type | 1066 * type variables declared in [parameter] on [element]. The bounds of the type |
| 1067 * variables are not set until [element] has been resolved. | 1067 * variables are not set until [element] has been resolved. |
| 1068 */ | 1068 */ |
| 1069 static Link<Type> createTypeVariables(TypeDeclarationElement element, | 1069 static Link<Type> createTypeVariables(TypeDeclarationElement element, |
| 1070 NodeList parameters) { | 1070 NodeList parameters) { |
| 1071 if (parameters === null) return const EmptyLink<Type>(); | 1071 if (parameters === null) return const EmptyLink<Type>(); |
| 1072 | 1072 |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 * there is an at-sign, '@'. The [value] of each of these instances | 1607 * there is an at-sign, '@'. The [value] of each of these instances |
| 1608 * are the same compile-time constant, [: const Data() :]. | 1608 * are the same compile-time constant, [: const Data() :]. |
| 1609 * | 1609 * |
| 1610 * The mirror system does not have a concept matching this class. | 1610 * The mirror system does not have a concept matching this class. |
| 1611 */ | 1611 */ |
| 1612 class MetadataAnnotation { | 1612 class MetadataAnnotation { |
| 1613 /** | 1613 /** |
| 1614 * The compile-time constant which this annotation resolves to. | 1614 * The compile-time constant which this annotation resolves to. |
| 1615 * In the mirror system, this would be an object mirror. | 1615 * In the mirror system, this would be an object mirror. |
| 1616 */ | 1616 */ |
| 1617 abstract Constant get value(); | 1617 abstract Constant get value; |
| 1618 Element annotatedElement; | 1618 Element annotatedElement; |
| 1619 int resolutionState; | 1619 int resolutionState; |
| 1620 | 1620 |
| 1621 MetadataAnnotation([this.resolutionState = STATE_NOT_STARTED]); | 1621 MetadataAnnotation([this.resolutionState = STATE_NOT_STARTED]); |
| 1622 | 1622 |
| 1623 abstract Node parseNode(DiagnosticListener listener); | 1623 abstract Node parseNode(DiagnosticListener listener); |
| 1624 | 1624 |
| 1625 MetadataAnnotation ensureResolved(Compiler compiler) { | 1625 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1626 if (resolutionState == STATE_NOT_STARTED) { | 1626 if (resolutionState == STATE_NOT_STARTED) { |
| 1627 compiler.resolver.resolveMetadataAnnotation(this); | 1627 compiler.resolver.resolveMetadataAnnotation(this); |
| 1628 } | 1628 } |
| 1629 return this; | 1629 return this; |
| 1630 } | 1630 } |
| 1631 | 1631 |
| 1632 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1632 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1633 } | 1633 } |
| OLD | NEW |