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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart

Issue 2771983004: Implement character offsets for fields and enum constants. (Closed)
Patch Set: Remove TODO. 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.kernel_library_builder; 5 library fasta.kernel_library_builder;
6 6
7 import 'package:kernel/ast.dart'; 7 import 'package:kernel/ast.dart';
8 8
9 import 'package:kernel/clone.dart' show CloneVisitor; 9 import 'package:kernel/clone.dart' show CloneVisitor;
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 nativeMethodName, 241 nativeMethodName,
242 redirectionTarget); 242 redirectionTarget);
243 currentDeclaration.addFactoryDeclaration(procedure, factoryDeclaration); 243 currentDeclaration.addFactoryDeclaration(procedure, factoryDeclaration);
244 addBuilder(name, procedure, charOffset); 244 addBuilder(name, procedure, charOffset);
245 if (nativeMethodName != null) { 245 if (nativeMethodName != null) {
246 addNativeMethod(procedure); 246 addNativeMethod(procedure);
247 } 247 }
248 } 248 }
249 249
250 void addEnum(List<MetadataBuilder> metadata, String name, 250 void addEnum(List<MetadataBuilder> metadata, String name,
251 List<String> constants, int charOffset, int charEndOffset) { 251 List<Object> constantNamesAndOffsets, int charOffset, int charEndOffset) {
252 addBuilder( 252 addBuilder(
253 name, 253 name,
254 new KernelEnumBuilder( 254 new KernelEnumBuilder(metadata, name, constantNamesAndOffsets, this,
255 metadata, name, constants, this, charOffset, charEndOffset), 255 charOffset, charEndOffset),
256 charOffset); 256 charOffset);
257 } 257 }
258 258
259 void addFunctionTypeAlias( 259 void addFunctionTypeAlias(
260 List<MetadataBuilder> metadata, 260 List<MetadataBuilder> metadata,
261 KernelTypeBuilder returnType, 261 KernelTypeBuilder returnType,
262 String name, 262 String name,
263 List<TypeVariableBuilder> typeVariables, 263 List<TypeVariableBuilder> typeVariables,
264 List<FormalParameterBuilder> formals, 264 List<FormalParameterBuilder> formals,
265 int charOffset) { 265 int charOffset) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 427 }
428 } 428 }
429 429
430 bool isConstructorName(String name, String className) { 430 bool isConstructorName(String name, String className) {
431 if (name.startsWith(className)) { 431 if (name.startsWith(className)) {
432 if (name.length == className.length) return true; 432 if (name.length == className.length) return true;
433 if (name.startsWith(".", className.length)) return true; 433 if (name.startsWith(".", className.length)) return true;
434 } 434 }
435 return false; 435 return false;
436 } 436 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698