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

Side by Side Diff: pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart

Issue 2539243002: Transition analyzer and analysis_server to new astFactory; remove old AST factory methods. (Closed)
Patch Set: Update CHANGELOG Created 4 years 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 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 11 import 'package:analyzer/dart/element/type.dart';
11 import 'package:analyzer/error/error.dart'; 12 import 'package:analyzer/error/error.dart';
12 import 'package:analyzer/exception/exception.dart'; 13 import 'package:analyzer/exception/exception.dart';
13 import 'package:analyzer/src/dart/ast/token.dart'; 14 import 'package:analyzer/src/dart/ast/token.dart';
14 import 'package:analyzer/src/dart/element/element.dart'; 15 import 'package:analyzer/src/dart/element/element.dart';
15 import 'package:analyzer/src/dart/element/member.dart'; 16 import 'package:analyzer/src/dart/element/member.dart';
16 import 'package:analyzer/src/dart/element/type.dart'; 17 import 'package:analyzer/src/dart/element/type.dart';
17 import 'package:analyzer/src/error/codes.dart'; 18 import 'package:analyzer/src/error/codes.dart';
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 * @param namedParameters the list of [String]s that are the named parameters 956 * @param namedParameters the list of [String]s that are the named parameters
956 * @return the created synthetic element 957 * @return the created synthetic element
957 */ 958 */
958 static ExecutableElement _createSyntheticExecutableElement( 959 static ExecutableElement _createSyntheticExecutableElement(
959 List<ExecutableElement> elementArrayToMerge, 960 List<ExecutableElement> elementArrayToMerge,
960 String name, 961 String name,
961 int numOfRequiredParameters, 962 int numOfRequiredParameters,
962 int numOfPositionalParameters, 963 int numOfPositionalParameters,
963 List<String> namedParameters) { 964 List<String> namedParameters) {
964 DynamicTypeImpl dynamicType = DynamicTypeImpl.instance; 965 DynamicTypeImpl dynamicType = DynamicTypeImpl.instance;
965 SimpleIdentifier nameIdentifier = 966 SimpleIdentifier nameIdentifier = astFactory
966 new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, name, 0)); 967 .simpleIdentifier(new StringToken(TokenType.IDENTIFIER, name, 0));
967 ExecutableElementImpl executable; 968 ExecutableElementImpl executable;
968 ExecutableElement elementToMerge = elementArrayToMerge[0]; 969 ExecutableElement elementToMerge = elementArrayToMerge[0];
969 if (elementToMerge is MethodElement) { 970 if (elementToMerge is MethodElement) {
970 MultiplyInheritedMethodElementImpl unionedMethod = 971 MultiplyInheritedMethodElementImpl unionedMethod =
971 new MultiplyInheritedMethodElementImpl(nameIdentifier); 972 new MultiplyInheritedMethodElementImpl(nameIdentifier);
972 unionedMethod.inheritedElements = elementArrayToMerge; 973 unionedMethod.inheritedElements = elementArrayToMerge;
973 executable = unionedMethod; 974 executable = unionedMethod;
974 } else if (elementToMerge is PropertyAccessorElement) { 975 } else if (elementToMerge is PropertyAccessorElement) {
975 MultiplyInheritedPropertyAccessorElementImpl unionedPropertyAccessor = 976 MultiplyInheritedPropertyAccessorElementImpl unionedPropertyAccessor =
976 new MultiplyInheritedPropertyAccessorElementImpl(nameIdentifier); 977 new MultiplyInheritedPropertyAccessorElementImpl(nameIdentifier);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 } 1248 }
1248 1249
1249 /** 1250 /**
1250 * Initializes [keys] and [values]. 1251 * Initializes [keys] and [values].
1251 */ 1252 */
1252 void _initArrays(int initialCapacity) { 1253 void _initArrays(int initialCapacity) {
1253 _keys = new List<String>(initialCapacity); 1254 _keys = new List<String>(initialCapacity);
1254 _values = new List<ExecutableElement>(initialCapacity); 1255 _values = new List<ExecutableElement>(initialCapacity);
1255 } 1256 }
1256 } 1257 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698