| 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 | 7 |
| 8 import '../tree/tree.dart'; | 8 import '../tree/tree.dart'; |
| 9 import '../util/util.dart'; | 9 import '../util/util.dart'; |
| 10 import '../resolution/resolution.dart'; | 10 import '../resolution/resolution.dart'; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 Compiler; | 23 Compiler; |
| 24 | 24 |
| 25 import '../dart_types.dart'; | 25 import '../dart_types.dart'; |
| 26 | 26 |
| 27 import '../scanner/scannerlib.dart' show Token, | 27 import '../scanner/scannerlib.dart' show Token, |
| 28 isUserDefinableOperator, | 28 isUserDefinableOperator, |
| 29 isMinusOperator; | 29 isMinusOperator; |
| 30 | 30 |
| 31 import '../ordered_typeset.dart' show OrderedTypeSet; | 31 import '../ordered_typeset.dart' show OrderedTypeSet; |
| 32 | 32 |
| 33 import 'visitor.dart' show ElementVisitor; |
| 34 |
| 33 const int STATE_NOT_STARTED = 0; | 35 const int STATE_NOT_STARTED = 0; |
| 34 const int STATE_STARTED = 1; | 36 const int STATE_STARTED = 1; |
| 35 const int STATE_DONE = 2; | 37 const int STATE_DONE = 2; |
| 36 | 38 |
| 37 class ElementCategory { | 39 class ElementCategory { |
| 38 /** | 40 /** |
| 39 * Represents things that we don't expect to find when looking in a | 41 * Represents things that we don't expect to find when looking in a |
| 40 * scope. | 42 * scope. |
| 41 */ | 43 */ |
| 42 static const int NONE = 0; | 44 static const int NONE = 0; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 void setFixedBackendName(String name); | 252 void setFixedBackendName(String name); |
| 251 | 253 |
| 252 Scope buildScope(); | 254 Scope buildScope(); |
| 253 | 255 |
| 254 /// If the element is a forwarding constructor, [targetConstructor] holds | 256 /// If the element is a forwarding constructor, [targetConstructor] holds |
| 255 /// the generative constructor that the forwarding constructor points to | 257 /// the generative constructor that the forwarding constructor points to |
| 256 /// (possibly via other forwarding constructors). | 258 /// (possibly via other forwarding constructors). |
| 257 FunctionElement get targetConstructor; | 259 FunctionElement get targetConstructor; |
| 258 | 260 |
| 259 void diagnose(Element context, DiagnosticListener listener); | 261 void diagnose(Element context, DiagnosticListener listener); |
| 262 |
| 263 accept(ElementVisitor visitor) => visitor.visitElement(this); |
| 260 } | 264 } |
| 261 | 265 |
| 262 class Elements { | 266 class Elements { |
| 263 static bool isUnresolved(Element e) { | 267 static bool isUnresolved(Element e) { |
| 264 return e == null || e.isErroneous(); | 268 return e == null || e.isErroneous(); |
| 265 } | 269 } |
| 266 static bool isErroneousElement(Element e) => e != null && e.isErroneous(); | 270 static bool isErroneousElement(Element e) => e != null && e.isErroneous(); |
| 267 | 271 |
| 268 /// Unwraps [element] reporting any warnings attached to it, if any. | 272 /// Unwraps [element] reporting any warnings attached to it, if any. |
| 269 static Element unwrap(Element element, | 273 static Element unwrap(Element element, |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 int get resolutionState; | 987 int get resolutionState; |
| 984 Token get beginToken; | 988 Token get beginToken; |
| 985 Token get endToken; | 989 Token get endToken; |
| 986 | 990 |
| 987 // TODO(kasperl): Try to get rid of these. | 991 // TODO(kasperl): Try to get rid of these. |
| 988 void set annotatedElement(Element value); | 992 void set annotatedElement(Element value); |
| 989 void set resolutionState(int value); | 993 void set resolutionState(int value); |
| 990 | 994 |
| 991 MetadataAnnotation ensureResolved(Compiler compiler); | 995 MetadataAnnotation ensureResolved(Compiler compiler); |
| 992 } | 996 } |
| OLD | NEW |