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

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1718603002: Add summary support for ConstructorElement.nameEnd and .periodOffset. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 /** 1055 /**
1056 * Resynthesize a [ConstructorElement] and place it in the given [holder]. 1056 * Resynthesize a [ConstructorElement] and place it in the given [holder].
1057 * [classType] is the type of the class for which this element is a 1057 * [classType] is the type of the class for which this element is a
1058 * constructor. 1058 * constructor.
1059 */ 1059 */
1060 void buildConstructor(UnlinkedExecutable serializedExecutable, 1060 void buildConstructor(UnlinkedExecutable serializedExecutable,
1061 ElementHolder holder, InterfaceType classType) { 1061 ElementHolder holder, InterfaceType classType) {
1062 assert(serializedExecutable.kind == UnlinkedExecutableKind.constructor); 1062 assert(serializedExecutable.kind == UnlinkedExecutableKind.constructor);
1063 currentConstructor = new ConstructorElementImpl( 1063 currentConstructor = new ConstructorElementImpl(
1064 serializedExecutable.name, serializedExecutable.nameOffset); 1064 serializedExecutable.name, serializedExecutable.nameOffset);
1065 if (serializedExecutable.name.isEmpty) {
1066 currentConstructor.nameEnd =
1067 serializedExecutable.nameOffset + classType.name.length;
1068 } else {
1069 currentConstructor.nameEnd = serializedExecutable.nameEnd;
1070 currentConstructor.periodOffset = serializedExecutable.periodOffset;
1071 }
1065 constructors[serializedExecutable.name] = currentConstructor; 1072 constructors[serializedExecutable.name] = currentConstructor;
1066 currentConstructor.returnType = classType; 1073 currentConstructor.returnType = classType;
1067 buildExecutableCommonParts(currentConstructor, serializedExecutable); 1074 buildExecutableCommonParts(currentConstructor, serializedExecutable);
1068 currentConstructor.factory = serializedExecutable.isFactory; 1075 currentConstructor.factory = serializedExecutable.isFactory;
1069 currentConstructor.const2 = serializedExecutable.isConst; 1076 currentConstructor.const2 = serializedExecutable.isConst;
1070 currentConstructor.constantInitializers = serializedExecutable 1077 currentConstructor.constantInitializers = serializedExecutable
1071 .constantInitializers 1078 .constantInitializers
1072 .map(buildConstantInitializer) 1079 .map(buildConstantInitializer)
1073 .toList(); 1080 .toList();
1074 if (serializedExecutable.isRedirectedConstructor) { 1081 if (serializedExecutable.isRedirectedConstructor) {
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 List<DartType> typeArguments = const <DartType>[]; 2419 List<DartType> typeArguments = const <DartType>[];
2413 if (numTypeArguments != 0) { 2420 if (numTypeArguments != 0) {
2414 typeArguments = <DartType>[]; 2421 typeArguments = <DartType>[];
2415 for (int i = 0; i < numTypeArguments; i++) { 2422 for (int i = 0; i < numTypeArguments; i++) {
2416 typeArguments.add(getTypeArgument(i)); 2423 typeArguments.add(getTypeArgument(i));
2417 } 2424 }
2418 } 2425 }
2419 return typeArguments; 2426 return typeArguments;
2420 } 2427 }
2421 } 2428 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698