| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(johnniwinther): Temporarily copied from analyzer2dart. Merge when | 5 // TODO(johnniwinther): Temporarily copied from analyzer2dart. Merge when |
| 6 // we shared code with the analyzer and this semantic visitor is complete. | 6 // we shared code with the analyzer and this semantic visitor is complete. |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Code for classifying the semantics of identifiers appearing in a Dart file. | 9 * Code for classifying the semantics of identifiers appearing in a Dart file. |
| 10 */ | 10 */ |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 COMPOUND, | 136 COMPOUND, |
| 137 | 137 |
| 138 /// The destination of the access is a compile-time constant. | 138 /// The destination of the access is a compile-time constant. |
| 139 CONSTANT, | 139 CONSTANT, |
| 140 | 140 |
| 141 /// The destination of the access is unresolved in a static context. | 141 /// The destination of the access is unresolved in a static context. |
| 142 UNRESOLVED, | 142 UNRESOLVED, |
| 143 | 143 |
| 144 /// The destination of the access is unresolved super access. | 144 /// The destination of the access is unresolved super access. |
| 145 UNRESOLVED_SUPER, | 145 UNRESOLVED_SUPER, |
| 146 |
| 147 /// The destination is invalid as an access. For instance a prefix used |
| 148 /// as an expression. |
| 149 INVALID, |
| 146 } | 150 } |
| 147 | 151 |
| 148 enum CompoundAccessKind { | 152 enum CompoundAccessKind { |
| 149 /// Read from a static getter and write to a static setter. | 153 /// Read from a static getter and write to a static setter. |
| 150 STATIC_GETTER_SETTER, | 154 STATIC_GETTER_SETTER, |
| 151 /// Read from a static method (closurize) and write to a static setter. | 155 /// Read from a static method (closurize) and write to a static setter. |
| 152 STATIC_METHOD_SETTER, | 156 STATIC_METHOD_SETTER, |
| 153 | 157 |
| 154 /// Read from an unresolved static getter and write to a static setter. | 158 /// Read from an unresolved static getter and write to a static setter. |
| 155 UNRESOLVED_STATIC_GETTER, | 159 UNRESOLVED_STATIC_GETTER, |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 : super._(AccessKind.TOPLEVEL_GETTER); | 354 : super._(AccessKind.TOPLEVEL_GETTER); |
| 351 | 355 |
| 352 StaticAccess.topLevelSetter(MethodElement this.element) | 356 StaticAccess.topLevelSetter(MethodElement this.element) |
| 353 : super._(AccessKind.TOPLEVEL_SETTER); | 357 : super._(AccessKind.TOPLEVEL_SETTER); |
| 354 | 358 |
| 355 StaticAccess.unresolved(this.element) | 359 StaticAccess.unresolved(this.element) |
| 356 : super._(AccessKind.UNRESOLVED); | 360 : super._(AccessKind.UNRESOLVED); |
| 357 | 361 |
| 358 StaticAccess.unresolvedSuper(this.element) | 362 StaticAccess.unresolvedSuper(this.element) |
| 359 : super._(AccessKind.UNRESOLVED_SUPER); | 363 : super._(AccessKind.UNRESOLVED_SUPER); |
| 364 |
| 365 StaticAccess.invalid(this.element) |
| 366 : super._(AccessKind.INVALID); |
| 360 } | 367 } |
| 361 | 368 |
| 362 class CompoundAccessSemantics extends AccessSemantics { | 369 class CompoundAccessSemantics extends AccessSemantics { |
| 363 final CompoundAccessKind compoundAccessKind; | 370 final CompoundAccessKind compoundAccessKind; |
| 364 final Element getter; | 371 final Element getter; |
| 365 final Element setter; | 372 final Element setter; |
| 366 | 373 |
| 367 CompoundAccessSemantics(this.compoundAccessKind, | 374 CompoundAccessSemantics(this.compoundAccessKind, |
| 368 this.getter, | 375 this.getter, |
| 369 this.setter) | 376 this.setter) |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 539 |
| 533 RedirectingFactoryConstructorAccessSemantics( | 540 RedirectingFactoryConstructorAccessSemantics( |
| 534 ConstructorAccessKind kind, | 541 ConstructorAccessKind kind, |
| 535 Element element, | 542 Element element, |
| 536 DartType type, | 543 DartType type, |
| 537 this.effectiveTargetSemantics) | 544 this.effectiveTargetSemantics) |
| 538 : super(kind, element, type); | 545 : super(kind, element, type); |
| 539 } | 546 } |
| 540 | 547 |
| 541 | 548 |
| OLD | NEW |