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.formal_parameter_builder; |
| 6 |
| 7 import 'package:dart_parser/src/parser.dart' show |
| 8 FormalParameterType; |
| 9 |
| 10 import 'builder.dart' show |
| 11 MetadataBuilder, |
| 12 ModifierBuilder, |
| 13 TypeBuilder; |
| 14 |
| 15 abstract class FormalParameterBuilder<T extends TypeBuilder> |
| 16 extends ModifierBuilder { |
| 17 final List<MetadataBuilder> metadata; |
| 18 |
| 19 final int modifiers; |
| 20 |
| 21 final T type; |
| 22 |
| 23 final String name; |
| 24 |
| 25 /// True if this parameter is on the form `this.name`. |
| 26 final bool hasThis; |
| 27 |
| 28 FormalParameterType kind = FormalParameterType.REQUIRED; |
| 29 |
| 30 FormalParameterBuilder(this.metadata, this.modifiers, this.type, this.name, |
| 31 this.hasThis); |
| 32 |
| 33 bool get isRequired => kind.isRequired; |
| 34 |
| 35 bool get isPositional => kind.isPositional; |
| 36 |
| 37 bool get isNamed => kind.isNamed; |
| 38 |
| 39 bool get isOptional => !isRequired; |
| 40 |
| 41 bool get isLocal => true; |
| 42 } |
OLD | NEW |