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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2991993002: Reapply 47ecf72 after it was reverted in e431e93e872d9a1c97a5177ebb09d5416f1d659a. (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.source_library_builder; 5 library fasta.source_library_builder;
6 6
7 import 'package:kernel/ast.dart' show ProcedureKind; 7 import 'package:kernel/ast.dart' show ProcedureKind;
8 8
9 import '../../base/resolve_relative_uri.dart' show resolveRelativeUri; 9 import '../../base/resolve_relative_uri.dart' show resolveRelativeUri;
10 10
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 String documentationComment, 212 String documentationComment,
213 List<MetadataBuilder> metadata, 213 List<MetadataBuilder> metadata,
214 String name, 214 String name,
215 List<TypeVariableBuilder> typeVariables, 215 List<TypeVariableBuilder> typeVariables,
216 int modifiers, 216 int modifiers,
217 T mixinApplication, 217 T mixinApplication,
218 List<T> interfaces, 218 List<T> interfaces,
219 int charOffset); 219 int charOffset);
220 220
221 void addField( 221 void addField(
222 String documentationComment,
222 List<MetadataBuilder> metadata, 223 List<MetadataBuilder> metadata,
223 int modifiers, 224 int modifiers,
224 T type, 225 T type,
225 String name, 226 String name,
226 int charOffset, 227 int charOffset,
227 Token initializerTokenForInference, 228 Token initializerTokenForInference,
228 bool hasInitializer); 229 bool hasInitializer);
229 230
230 void addFields(List<MetadataBuilder> metadata, int modifiers, T type, 231 void addFields(String documentationComment, List<MetadataBuilder> metadata,
231 List<Object> fieldsInfo) { 232 int modifiers, T type, List<Object> fieldsInfo) {
232 for (int i = 0; i < fieldsInfo.length; i += 4) { 233 for (int i = 0; i < fieldsInfo.length; i += 4) {
233 String name = fieldsInfo[i]; 234 String name = fieldsInfo[i];
234 int charOffset = fieldsInfo[i + 1]; 235 int charOffset = fieldsInfo[i + 1];
235 bool hasInitializer = fieldsInfo[i + 2] != null; 236 bool hasInitializer = fieldsInfo[i + 2] != null;
236 Token initializerTokenForInference = 237 Token initializerTokenForInference =
237 type == null ? fieldsInfo[i + 2] : null; 238 type == null ? fieldsInfo[i + 2] : null;
238 if (initializerTokenForInference != null) { 239 if (initializerTokenForInference != null) {
239 Token beforeLast = fieldsInfo[i + 3]; 240 Token beforeLast = fieldsInfo[i + 3];
240 beforeLast.setNext(new Token.eof(beforeLast.next.offset)); 241 beforeLast.setNext(new Token.eof(beforeLast.next.offset));
241 } 242 }
242 addField(metadata, modifiers, type, name, charOffset, 243 addField(documentationComment, metadata, modifiers, type, name,
243 initializerTokenForInference, hasInitializer); 244 charOffset, initializerTokenForInference, hasInitializer);
244 } 245 }
245 } 246 }
246 247
247 void addProcedure( 248 void addProcedure(
249 String documentationComment,
248 List<MetadataBuilder> metadata, 250 List<MetadataBuilder> metadata,
249 int modifiers, 251 int modifiers,
250 T returnType, 252 T returnType,
251 String name, 253 String name,
252 List<TypeVariableBuilder> typeVariables, 254 List<TypeVariableBuilder> typeVariables,
253 List<FormalParameterBuilder> formals, 255 List<FormalParameterBuilder> formals,
254 ProcedureKind kind, 256 ProcedureKind kind,
255 int charOffset, 257 int charOffset,
256 int charOpenParenOffset, 258 int charOpenParenOffset,
257 int charEndOffset, 259 int charEndOffset,
(...skipping 10 matching lines...) Expand all
268 FunctionTypeBuilder type, 270 FunctionTypeBuilder type,
269 int charOffset); 271 int charOffset);
270 272
271 FunctionTypeBuilder addFunctionType( 273 FunctionTypeBuilder addFunctionType(
272 T returnType, 274 T returnType,
273 List<TypeVariableBuilder> typeVariables, 275 List<TypeVariableBuilder> typeVariables,
274 List<FormalParameterBuilder> formals, 276 List<FormalParameterBuilder> formals,
275 int charOffset); 277 int charOffset);
276 278
277 void addFactoryMethod( 279 void addFactoryMethod(
280 String documentationComment,
278 List<MetadataBuilder> metadata, 281 List<MetadataBuilder> metadata,
279 int modifiers, 282 int modifiers,
280 ConstructorReferenceBuilder name, 283 ConstructorReferenceBuilder name,
281 List<FormalParameterBuilder> formals, 284 List<FormalParameterBuilder> formals,
282 ConstructorReferenceBuilder redirectionTarget, 285 ConstructorReferenceBuilder redirectionTarget,
283 int charOffset, 286 int charOffset,
284 int charOpenParenOffset, 287 int charOpenParenOffset,
285 int charEndOffset, 288 int charEndOffset,
286 String nativeMethodName); 289 String nativeMethodName);
287 290
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 /// synthesize type variables on the factory matching the class'. 652 /// synthesize type variables on the factory matching the class'.
650 void addFactoryDeclaration( 653 void addFactoryDeclaration(
651 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { 654 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) {
652 factoryDeclarations[procedure] = factoryDeclaration; 655 factoryDeclarations[procedure] = factoryDeclaration;
653 } 656 }
654 657
655 Scope toScope(Scope parent) { 658 Scope toScope(Scope parent) {
656 return new Scope(members, setters, parent, isModifiable: false); 659 return new Scope(members, setters, parent, isModifiable: false);
657 } 660 }
658 } 661 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698