OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library fasta.mixin_application_builder; |
| 6 |
| 7 import 'builder.dart' show |
| 8 TypeBuilder; |
| 9 |
| 10 import 'scope.dart' show |
| 11 Scope; |
| 12 |
| 13 abstract class MixinApplicationBuilder<T extends TypeBuilder> |
| 14 extends TypeBuilder { |
| 15 final T supertype; |
| 16 final List<T> mixins; |
| 17 |
| 18 MixinApplicationBuilder(this.supertype, this.mixins); |
| 19 |
| 20 void resolveIn(Scope scope) { |
| 21 supertype.resolveIn(scope); |
| 22 for (T t in mixins) { |
| 23 t.resolveIn(scope); |
| 24 } |
| 25 } |
| 26 |
| 27 String get debugName => "MixinApplicationBuilder"; |
| 28 |
| 29 StringBuffer printOn(StringBuffer buffer) { |
| 30 buffer.write(supertype); |
| 31 buffer.write(" with "); |
| 32 bool first = true; |
| 33 for (T t in mixins) { |
| 34 if (!first) buffer.write(", "); |
| 35 first = false; |
| 36 t.printOn(buffer); |
| 37 } |
| 38 return buffer; |
| 39 } |
| 40 } |
OLD | NEW |