| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 SimpleIdentifier identifier = AstFactory.identifier3(name); | 451 SimpleIdentifier identifier = AstFactory.identifier3(name); |
| 452 identifier.staticElement = resynthesizer.currentConstructor.parameters | 452 identifier.staticElement = resynthesizer.currentConstructor.parameters |
| 453 .firstWhere((parameter) => parameter.name == name, | 453 .firstWhere((parameter) => parameter.name == name, |
| 454 orElse: () => throw new StateError( | 454 orElse: () => throw new StateError( |
| 455 'Unable to resolve constructor parameter: $name')); | 455 'Unable to resolve constructor parameter: $name')); |
| 456 _push(identifier); | 456 _push(identifier); |
| 457 break; | 457 break; |
| 458 case UnlinkedConstOperation.assignToRef: | 458 case UnlinkedConstOperation.assignToRef: |
| 459 case UnlinkedConstOperation.assignToProperty: | 459 case UnlinkedConstOperation.assignToProperty: |
| 460 case UnlinkedConstOperation.assignToIndex: | 460 case UnlinkedConstOperation.assignToIndex: |
| 461 case UnlinkedConstOperation.extractIndex: |
| 461 throw new UnimplementedError('$operation'); | 462 throw new UnimplementedError('$operation'); |
| 462 } | 463 } |
| 463 } | 464 } |
| 464 return stack.single; | 465 return stack.single; |
| 465 } | 466 } |
| 466 | 467 |
| 467 /** | 468 /** |
| 468 * Build the identifier sequence (a single or prefixed identifier, or a | 469 * Build the identifier sequence (a single or prefixed identifier, or a |
| 469 * property access) corresponding to the given reference [info]. | 470 * property access) corresponding to the given reference [info]. |
| 470 */ | 471 */ |
| (...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 static String _getElementIdentifier(String name, ReferenceKind kind) { | 2614 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 2614 if (kind == ReferenceKind.topLevelPropertyAccessor || | 2615 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 2615 kind == ReferenceKind.propertyAccessor) { | 2616 kind == ReferenceKind.propertyAccessor) { |
| 2616 if (!name.endsWith('=')) { | 2617 if (!name.endsWith('=')) { |
| 2617 return name + '?'; | 2618 return name + '?'; |
| 2618 } | 2619 } |
| 2619 } | 2620 } |
| 2620 return name; | 2621 return name; |
| 2621 } | 2622 } |
| 2622 } | 2623 } |
| OLD | NEW |