| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 String get message => '${messageKind.message(messageArguments)}'; | 324 String get message => '${messageKind.message(messageArguments)}'; |
| 325 | 325 |
| 326 String toString() => '<$name: $message>'; | 326 String toString() => '<$name: $message>'; |
| 327 | 327 |
| 328 accept(ElementVisitor visitor) => visitor.visitErroneousElement(this); | 328 accept(ElementVisitor visitor) => visitor.visitErroneousElement(this); |
| 329 } | 329 } |
| 330 | 330 |
| 331 /// A constructor that was synthesized to recover from a compile-time error. | 331 /// A constructor that was synthesized to recover from a compile-time error. |
| 332 class ErroneousConstructorElementX extends ErroneousElementX | 332 class ErroneousConstructorElementX extends ErroneousElementX |
| 333 with PatchMixin<FunctionElement> | 333 with PatchMixin<FunctionElement>, AnalyzableElementX |
| 334 implements ConstructorElementX { | 334 implements ConstructorElementX { |
| 335 // TODO(ahe): Instead of subclassing [ErroneousElementX], this class should | 335 // TODO(ahe): Instead of subclassing [ErroneousElementX], this class should |
| 336 // be more like [ErroneousFieldElementX]. In particular, its kind should be | 336 // be more like [ErroneousFieldElementX]. In particular, its kind should be |
| 337 // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much. | 337 // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much. |
| 338 | 338 |
| 339 ErroneousConstructorElementX( | 339 ErroneousConstructorElementX( |
| 340 MessageKind messageKind, | 340 MessageKind messageKind, |
| 341 Map messageArguments, | 341 Map messageArguments, |
| 342 String name, | 342 String name, |
| 343 Element enclosing) | 343 Element enclosing) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 | 547 |
| 548 /// Element synthesized to recover from a duplicated member of an element. | 548 /// Element synthesized to recover from a duplicated member of an element. |
| 549 class DuplicatedElementX extends AmbiguousElementX { | 549 class DuplicatedElementX extends AmbiguousElementX { |
| 550 DuplicatedElementX( | 550 DuplicatedElementX( |
| 551 MessageKind messageKind, | 551 MessageKind messageKind, |
| 552 Map messageArguments, | 552 Map messageArguments, |
| 553 Element enclosingElement, Element existingElement, Element newElement) | 553 Element enclosingElement, Element existingElement, Element newElement) |
| 554 : super(messageKind, messageArguments, enclosingElement, existingElement, | 554 : super(messageKind, messageArguments, enclosingElement, existingElement, |
| 555 newElement); | 555 newElement); |
| 556 |
| 557 bool get isErroneous => true; |
| 556 } | 558 } |
| 557 | 559 |
| 558 class ScopeX { | 560 class ScopeX { |
| 559 final Map<String, Element> contents = new Map<String, Element>(); | 561 final Map<String, Element> contents = new Map<String, Element>(); |
| 560 | 562 |
| 561 bool get isEmpty => contents.isEmpty; | 563 bool get isEmpty => contents.isEmpty; |
| 562 Iterable<Element> get values => contents.values; | 564 Iterable<Element> get values => contents.values; |
| 563 | 565 |
| 564 Element lookup(String name) { | 566 Element lookup(String name) { |
| 565 return contents[name]; | 567 return contents[name]; |
| (...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3042 AstElement get definingElement; | 3044 AstElement get definingElement; |
| 3043 | 3045 |
| 3044 bool get hasResolvedAst => definingElement.hasTreeElements; | 3046 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 3045 | 3047 |
| 3046 ResolvedAst get resolvedAst { | 3048 ResolvedAst get resolvedAst { |
| 3047 return new ResolvedAst(declaration, | 3049 return new ResolvedAst(declaration, |
| 3048 definingElement.node, definingElement.treeElements); | 3050 definingElement.node, definingElement.treeElements); |
| 3049 } | 3051 } |
| 3050 | 3052 |
| 3051 } | 3053 } |
| OLD | NEW |