| 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 'elements.dart'; | 7 import 'elements.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../helpers/helpers.dart'; // Included for debug helpers. | 9 import '../helpers/helpers.dart'; // Included for debug helpers. |
| 10 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 FunctionElement asFunctionElement() => this; | 323 FunctionElement asFunctionElement() => this; |
| 324 | 324 |
| 325 String get message => '${messageKind.message(messageArguments)}'; | 325 String get message => '${messageKind.message(messageArguments)}'; |
| 326 | 326 |
| 327 String toString() => '<$name: $message>'; | 327 String toString() => '<$name: $message>'; |
| 328 | 328 |
| 329 accept(ElementVisitor visitor) => visitor.visitErroneousElement(this); | 329 accept(ElementVisitor visitor) => visitor.visitErroneousElement(this); |
| 330 } | 330 } |
| 331 | 331 |
| 332 /// A constructor that was synthesized to recover from a compile-time error. |
| 333 class ErroneousConstructorElementX extends ErroneousElementX { |
| 334 // TODO(ahe): Instead of subclassing [ErroneousElementX], this class should |
| 335 // be more like [ErroneousFieldElementX]. In particular, its kind should be |
| 336 // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much. |
| 337 |
| 338 ErroneousConstructorElementX( |
| 339 MessageKind messageKind, |
| 340 Map messageArguments, |
| 341 String name, |
| 342 Element enclosing) |
| 343 : super(messageKind, messageArguments, name, enclosing); |
| 344 } |
| 345 |
| 332 /// A message attached to a [WarnOnUseElementX]. | 346 /// A message attached to a [WarnOnUseElementX]. |
| 333 class WrappedMessage { | 347 class WrappedMessage { |
| 334 /// The message position. If [:null:] the position of the reference to the | 348 /// The message position. If [:null:] the position of the reference to the |
| 335 /// [WarnOnUseElementX] is used. | 349 /// [WarnOnUseElementX] is used. |
| 336 final Spannable spannable; | 350 final Spannable spannable; |
| 337 | 351 |
| 338 /** | 352 /** |
| 339 * The message to report on resolving a wrapped element. | 353 * The message to report on resolving a wrapped element. |
| 340 */ | 354 */ |
| 341 final MessageKind messageKind; | 355 final MessageKind messageKind; |
| (...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2903 AstElement get definingElement; | 2917 AstElement get definingElement; |
| 2904 | 2918 |
| 2905 bool get hasResolvedAst => definingElement.hasTreeElements; | 2919 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 2906 | 2920 |
| 2907 ResolvedAst get resolvedAst { | 2921 ResolvedAst get resolvedAst { |
| 2908 return new ResolvedAst(declaration, | 2922 return new ResolvedAst(declaration, |
| 2909 definingElement.node, definingElement.treeElements); | 2923 definingElement.node, definingElement.treeElements); |
| 2910 } | 2924 } |
| 2911 | 2925 |
| 2912 } | 2926 } |
| OLD | NEW |