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.member_builder; | 5 library fasta.member_builder; |
6 | 6 |
7 import 'builder.dart' show Builder, ClassBuilder, ModifierBuilder; | 7 import 'builder.dart' show Builder, ClassBuilder, ModifierBuilder; |
8 | 8 |
9 abstract class MemberBuilder extends ModifierBuilder { | 9 abstract class MemberBuilder extends ModifierBuilder { |
10 /// For top-level members, the parent is set correctly during | 10 /// For top-level members, the parent is set correctly during |
11 /// construction. However, for class members, the parent is initially the | 11 /// construction. However, for class members, the parent is initially the |
12 /// library and updated later. | 12 /// library and updated later. |
13 Builder parent; | 13 Builder parent; |
14 | 14 |
15 String get name; | 15 String get name; |
16 | 16 |
17 MemberBuilder(Builder parent, int charOffset) | 17 MemberBuilder(Builder parent, int charOffset) |
18 : parent = parent, | 18 : parent = parent, |
19 super(parent, charOffset); | 19 super(parent, charOffset); |
20 | 20 |
21 bool get isInstanceMember => isClassMember && !isStatic; | 21 bool get isInstanceMember => isClassMember && !isStatic; |
22 | 22 |
23 bool get isClassMember => parent is ClassBuilder; | 23 bool get isClassMember => parent is ClassBuilder; |
24 | 24 |
25 bool get isTopLevel => !isClassMember; | 25 bool get isTopLevel => !isClassMember; |
26 | 26 |
27 bool get isNative => false; | 27 bool get isNative => false; |
| 28 |
| 29 @override |
| 30 String get fullNameForErrors => name; |
28 } | 31 } |
OLD | NEW |