| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.mixin_application_builder; | 5 library fasta.mixin_application_builder; |
| 6 | 6 |
| 7 import '../errors.dart' show | 7 import '../errors.dart' show |
| 8 internalError; | 8 internalError; |
| 9 | 9 |
| 10 import 'builder.dart' show | 10 import 'builder.dart' show |
| 11 TypeBuilder, | 11 TypeBuilder, |
| 12 TypeDeclarationBuilder; | 12 TypeDeclarationBuilder, |
| 13 TypeVariableBuilder; |
| 13 | 14 |
| 14 import 'scope.dart' show | 15 import 'scope.dart' show |
| 15 Scope; | 16 Scope; |
| 16 | 17 |
| 17 abstract class MixinApplicationBuilder<T extends TypeBuilder> | 18 abstract class MixinApplicationBuilder<T extends TypeBuilder> |
| 18 extends TypeBuilder { | 19 extends TypeBuilder { |
| 19 final T supertype; | 20 final T supertype; |
| 20 final List<T> mixins; | 21 final List<T> mixins; |
| 21 | 22 |
| 22 MixinApplicationBuilder(this.supertype, this.mixins, int charOffset, | 23 MixinApplicationBuilder(this.supertype, this.mixins, int charOffset, |
| 23 Uri fileUri) | 24 Uri fileUri) |
| 24 : super(charOffset, fileUri); | 25 : super(charOffset, fileUri); |
| 25 | 26 |
| 27 void set typeVariables(List<TypeVariableBuilder> variables); |
| 28 |
| 29 void set subclassName(String value); |
| 30 |
| 26 String get name => null; | 31 String get name => null; |
| 27 | 32 |
| 28 void resolveIn(Scope scope) { | 33 void resolveIn(Scope scope) { |
| 29 supertype.resolveIn(scope); | 34 supertype.resolveIn(scope); |
| 30 for (T t in mixins) { | 35 for (T t in mixins) { |
| 31 t.resolveIn(scope); | 36 t.resolveIn(scope); |
| 32 } | 37 } |
| 33 } | 38 } |
| 34 | 39 |
| 35 void bind(TypeDeclarationBuilder builder) { | 40 void bind(TypeDeclarationBuilder builder) { |
| 36 internalError("Internal error: can't bind a mixin application."); | 41 internalError("Internal error: can't bind a mixin application."); |
| 37 } | 42 } |
| 38 | 43 |
| 39 String get debugName => "MixinApplicationBuilder"; | 44 String get debugName => "MixinApplicationBuilder"; |
| 40 | 45 |
| 41 StringBuffer printOn(StringBuffer buffer) { | 46 StringBuffer printOn(StringBuffer buffer) { |
| 42 buffer.write(supertype); | 47 buffer.write(supertype); |
| 43 buffer.write(" with "); | 48 buffer.write(" with "); |
| 44 bool first = true; | 49 bool first = true; |
| 45 for (T t in mixins) { | 50 for (T t in mixins) { |
| 46 if (!first) buffer.write(", "); | 51 if (!first) buffer.write(", "); |
| 47 first = false; | 52 first = false; |
| 48 t.printOn(buffer); | 53 t.printOn(buffer); |
| 49 } | 54 } |
| 50 return buffer; | 55 return buffer; |
| 51 } | 56 } |
| 52 } | 57 } |
| OLD | NEW |