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

Side by Side Diff: pkg/analyzer/lib/src/generated/testing/element_factory.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 | « no previous file | pkg/analyzer/lib/src/summary/format.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.testing.element_factory; 5 library analyzer.src.generated.testing.element_factory;
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 static ConstLocalVariableElementImpl constLocalVariableElement(String name) => 93 static ConstLocalVariableElementImpl constLocalVariableElement(String name) =>
94 new ConstLocalVariableElementImpl(name, 0); 94 new ConstLocalVariableElementImpl(name, 0);
95 95
96 static ConstructorElementImpl constructorElement( 96 static ConstructorElementImpl constructorElement(
97 ClassElement definingClass, String name, bool isConst, 97 ClassElement definingClass, String name, bool isConst,
98 [List<DartType> argumentTypes]) { 98 [List<DartType> argumentTypes]) {
99 DartType type = definingClass.type; 99 DartType type = definingClass.type;
100 ConstructorElementImpl constructor = name == null 100 ConstructorElementImpl constructor = name == null
101 ? new ConstructorElementImpl("", -1) 101 ? new ConstructorElementImpl("", -1)
102 : new ConstructorElementImpl(name, 0); 102 : new ConstructorElementImpl(name, 0);
103 if (name != null) {
104 if (name.isEmpty) {
105 constructor.nameEnd = definingClass.name.length;
106 } else {
107 constructor.periodOffset = definingClass.name.length;
108 constructor.nameEnd = definingClass.name.length + name.length + 1;
109 }
110 }
103 constructor.synthetic = name == null; 111 constructor.synthetic = name == null;
104 constructor.const2 = isConst; 112 constructor.const2 = isConst;
105 if (argumentTypes != null) { 113 if (argumentTypes != null) {
106 int count = argumentTypes.length; 114 int count = argumentTypes.length;
107 List<ParameterElement> parameters = new List<ParameterElement>(count); 115 List<ParameterElement> parameters = new List<ParameterElement>(count);
108 for (int i = 0; i < count; i++) { 116 for (int i = 0; i < count; i++) {
109 ParameterElementImpl parameter = new ParameterElementImpl("a$i", i); 117 ParameterElementImpl parameter = new ParameterElementImpl("a$i", i);
110 parameter.type = argumentTypes[i]; 118 parameter.type = argumentTypes[i];
111 parameter.parameterKind = ParameterKind.REQUIRED; 119 parameter.parameterKind = ParameterKind.REQUIRED;
112 parameters[i] = parameter; 120 parameters[i] = parameter;
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 651 }
644 652
645 static TypeParameterElementImpl typeParameterWithType(String name, 653 static TypeParameterElementImpl typeParameterWithType(String name,
646 [DartType bound]) { 654 [DartType bound]) {
647 TypeParameterElementImpl typeParameter = typeParameterElement(name); 655 TypeParameterElementImpl typeParameter = typeParameterElement(name);
648 typeParameter.type = new TypeParameterTypeImpl(typeParameter); 656 typeParameter.type = new TypeParameterTypeImpl(typeParameter);
649 typeParameter.bound = bound; 657 typeParameter.bound = bound;
650 return typeParameter; 658 return typeParameter;
651 } 659 }
652 } 660 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698