Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/formal_parameter_builder.dart

Issue 2691523002: Ensure locations are always provided, but don't store them yet. (Closed)
Patch Set: Address comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.formal_parameter_builder; 5 library fasta.formal_parameter_builder;
6 6
7 import 'package:front_end/src/fasta/parser/parser.dart' show 7 import 'package:front_end/src/fasta/parser/parser.dart' show
8 FormalParameterType; 8 FormalParameterType;
9 9
10 import 'builder.dart' show 10 import 'builder.dart' show
11 LibraryBuilder,
11 MetadataBuilder, 12 MetadataBuilder,
12 ModifierBuilder, 13 ModifierBuilder,
13 TypeBuilder; 14 TypeBuilder;
14 15
15 abstract class FormalParameterBuilder<T extends TypeBuilder> 16 abstract class FormalParameterBuilder<T extends TypeBuilder>
16 extends ModifierBuilder { 17 extends ModifierBuilder {
17 final List<MetadataBuilder> metadata; 18 final List<MetadataBuilder> metadata;
18 19
19 final int modifiers; 20 final int modifiers;
20 21
21 final T type; 22 final T type;
22 23
23 final String name; 24 final String name;
24 25
25 /// True if this parameter is on the form `this.name`. 26 /// True if this parameter is on the form `this.name`.
26 final bool hasThis; 27 final bool hasThis;
27 28
28 FormalParameterType kind = FormalParameterType.REQUIRED; 29 FormalParameterType kind = FormalParameterType.REQUIRED;
29 30
30 FormalParameterBuilder(this.metadata, this.modifiers, this.type, this.name, 31 FormalParameterBuilder(this.metadata, this.modifiers, this.type, this.name,
31 this.hasThis); 32 this.hasThis, LibraryBuilder compilationUnit, int charOffset)
33 : super(compilationUnit, charOffset);
32 34
33 bool get isRequired => kind.isRequired; 35 bool get isRequired => kind.isRequired;
34 36
35 bool get isPositional => kind.isPositional; 37 bool get isPositional => kind.isPositional;
36 38
37 bool get isNamed => kind.isNamed; 39 bool get isNamed => kind.isNamed;
38 40
39 bool get isOptional => !isRequired; 41 bool get isOptional => !isRequired;
40 42
41 bool get isLocal => true; 43 bool get isLocal => true;
42 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698