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

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

Issue 2759173002: Switch to IdentifierContext. (Closed)
Patch Set: Status file. Created 3 years, 9 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.class_builder; 5 library fasta.class_builder;
6 6
7 import '../errors.dart' show internalError; 7 import '../errors.dart' show internalError;
8 8
9 import 'builder.dart' 9 import 'builder.dart'
10 show 10 show
11 Builder, 11 Builder,
12 ConstructorReferenceBuilder, 12 ConstructorReferenceBuilder,
13 LibraryBuilder, 13 LibraryBuilder,
14 MetadataBuilder, 14 MetadataBuilder,
15 MixinApplicationBuilder, 15 MixinApplicationBuilder,
16 NamedTypeBuilder, 16 NamedTypeBuilder,
17 TypeBuilder, 17 TypeBuilder,
18 TypeDeclarationBuilder, 18 TypeDeclarationBuilder,
19 TypeVariableBuilder; 19 TypeVariableBuilder;
20 20
21 import 'scope.dart' show AmbiguousBuilder, Scope; 21 import 'scope.dart' show AccessErrorBuilder, AmbiguousBuilder, Scope;
22 22
23 abstract class ClassBuilder<T extends TypeBuilder, R> 23 abstract class ClassBuilder<T extends TypeBuilder, R>
24 extends TypeDeclarationBuilder<T, R> { 24 extends TypeDeclarationBuilder<T, R> {
25 final List<TypeVariableBuilder> typeVariables; 25 final List<TypeVariableBuilder> typeVariables;
26 26
27 T supertype; 27 T supertype;
28 28
29 List<T> interfaces; 29 List<T> interfaces;
30 30
31 final Map<String, Builder> members; 31 final Map<String, Builder> members;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (builder?.next != null) { 86 if (builder?.next != null) {
87 Builder getterBuilder; 87 Builder getterBuilder;
88 Builder setterBuilder; 88 Builder setterBuilder;
89 Builder current = builder; 89 Builder current = builder;
90 while (current != null) { 90 while (current != null) {
91 if (current.isGetter && getterBuilder == null) { 91 if (current.isGetter && getterBuilder == null) {
92 getterBuilder = current; 92 getterBuilder = current;
93 } else if (current.isSetter && setterBuilder == null) { 93 } else if (current.isSetter && setterBuilder == null) {
94 setterBuilder = current; 94 setterBuilder = current;
95 } else { 95 } else {
96 return new AmbiguousBuilder(builder, charOffset, fileUri); 96 return new AmbiguousBuilder(name, builder, charOffset, fileUri);
97 } 97 }
98 current = current.next; 98 current = current.next;
99 } 99 }
100 if (getterBuilder?.isInstanceMember ?? false) {
101 getterBuilder = null;
102 }
103 if (setterBuilder?.isInstanceMember ?? false) {
104 setterBuilder = null;
105 }
100 builder = isSetter ? setterBuilder : getterBuilder; 106 builder = isSetter ? setterBuilder : getterBuilder;
107 if (builder == null) {
108 if (isSetter && getterBuilder != null) {
109 return new AccessErrorBuilder(name, getterBuilder, charOffset, fileUri );
110 } else if (!isSetter && setterBuilder != null) {
111 return new AccessErrorBuilder(name, setterBuilder, charOffset, fileUri );
112 }
113 }
101 } 114 }
102 if (builder == null) { 115 if (builder == null) {
103 return null; 116 return null;
104 } else if (isSetter && builder.isGetter) { 117 } else if (isSetter && builder.isGetter) {
105 return null; 118 return null;
106 } else { 119 } else {
107 return builder.isInstanceMember ? null : builder; 120 return builder.isInstanceMember ? null : builder;
108 } 121 }
109 } 122 }
110 123
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 argument = argument.subst(substitutionMap); 179 argument = argument.subst(substitutionMap);
167 } 180 }
168 directSubstitutionMap[variables[i]] = argument; 181 directSubstitutionMap[variables[i]] = argument;
169 } 182 }
170 substitutionMap = directSubstitutionMap; 183 substitutionMap = directSubstitutionMap;
171 } 184 }
172 } 185 }
173 return substitutionMap; 186 return substitutionMap;
174 } 187 }
175 } 188 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/builder.dart ('k') | pkg/front_end/lib/src/fasta/builder/dynamic_type_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698