| OLD | NEW |
| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 .instanceCreationExpression(Keyword.CONST, constructorNode, arguments); | 667 .instanceCreationExpression(Keyword.CONST, constructorNode, arguments); |
| 668 instanceCreation.staticElement = constructorElement; | 668 instanceCreation.staticElement = constructorElement; |
| 669 _push(instanceCreation); | 669 _push(instanceCreation); |
| 670 } | 670 } |
| 671 | 671 |
| 672 void _pushInvokeMethodRef() { | 672 void _pushInvokeMethodRef() { |
| 673 List<Expression> arguments = _buildArguments(); | 673 List<Expression> arguments = _buildArguments(); |
| 674 EntityRef ref = uc.references[refPtr++]; | 674 EntityRef ref = uc.references[refPtr++]; |
| 675 _ReferenceInfo info = resynthesizer.getReferenceInfo(ref.reference); | 675 _ReferenceInfo info = resynthesizer.getReferenceInfo(ref.reference); |
| 676 Expression node = _buildIdentifierSequence(info); | 676 Expression node = _buildIdentifierSequence(info); |
| 677 TypeArgumentList typeArguments; |
| 678 int numTypeArguments = uc.ints[intPtr++]; |
| 679 if (numTypeArguments > 0) { |
| 680 List<TypeName> typeNames = new List<TypeName>(numTypeArguments); |
| 681 for (int i = 0; i < numTypeArguments; i++) { |
| 682 typeNames[i] = _newTypeName(); |
| 683 } |
| 684 typeArguments = AstFactory.typeArgumentList(typeNames); |
| 685 } |
| 677 if (node is SimpleIdentifier) { | 686 if (node is SimpleIdentifier) { |
| 678 _push(new MethodInvocation( | 687 _push(new MethodInvocation( |
| 679 null, | 688 null, |
| 680 TokenFactory.tokenFromType(TokenType.PERIOD), | 689 TokenFactory.tokenFromType(TokenType.PERIOD), |
| 681 node, | 690 node, |
| 682 null, | 691 typeArguments, |
| 683 AstFactory.argumentList(arguments))); | 692 AstFactory.argumentList(arguments))); |
| 684 } else { | 693 } else { |
| 685 throw new UnimplementedError('For ${node?.runtimeType}: $node'); | 694 throw new UnimplementedError('For ${node?.runtimeType}: $node'); |
| 686 } | 695 } |
| 687 } | 696 } |
| 688 | 697 |
| 689 void _pushList(TypeArgumentList typeArguments) { | 698 void _pushList(TypeArgumentList typeArguments) { |
| 690 int count = uc.ints[intPtr++]; | 699 int count = uc.ints[intPtr++]; |
| 691 List<Expression> elements = <Expression>[]; | 700 List<Expression> elements = <Expression>[]; |
| 692 for (int i = 0; i < count; i++) { | 701 for (int i = 0; i < count; i++) { |
| (...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 static String _getElementIdentifier(String name, ReferenceKind kind) { | 2495 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 2487 if (kind == ReferenceKind.topLevelPropertyAccessor || | 2496 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 2488 kind == ReferenceKind.propertyAccessor) { | 2497 kind == ReferenceKind.propertyAccessor) { |
| 2489 if (!name.endsWith('=')) { | 2498 if (!name.endsWith('=')) { |
| 2490 return name + '?'; | 2499 return name + '?'; |
| 2491 } | 2500 } |
| 2492 } | 2501 } |
| 2493 return name; | 2502 return name; |
| 2494 } | 2503 } |
| 2495 } | 2504 } |
| OLD | NEW |