OLD | NEW |
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 library serialization.summarize_const_expr; | 5 library serialization.summarize_const_expr; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/element/type.dart' show DartType; | 9 import 'package:analyzer/dart/element/type.dart' show DartType; |
10 import 'package:analyzer/src/summary/format.dart'; | 10 import 'package:analyzer/src/summary/format.dart'; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 assignmentOperators.add(operator); | 625 assignmentOperators.add(operator); |
626 _pushAssignable(operand); | 626 _pushAssignable(operand); |
627 } | 627 } |
628 | 628 |
629 void _serializePropertyAccess(PropertyAccess expr) { | 629 void _serializePropertyAccess(PropertyAccess expr) { |
630 if (_isIdentifierSequence(expr)) { | 630 if (_isIdentifierSequence(expr)) { |
631 EntityRefBuilder ref = serializeIdentifierSequence(expr); | 631 EntityRefBuilder ref = serializeIdentifierSequence(expr); |
632 references.add(ref); | 632 references.add(ref); |
633 operations.add(UnlinkedExprOperation.pushReference); | 633 operations.add(UnlinkedExprOperation.pushReference); |
634 } else { | 634 } else { |
635 _serialize(expr.target); | 635 if (!expr.isCascaded) { |
| 636 _serialize(expr.target); |
| 637 } |
636 strings.add(expr.propertyName.name); | 638 strings.add(expr.propertyName.name); |
637 operations.add(UnlinkedExprOperation.extractProperty); | 639 operations.add(UnlinkedExprOperation.extractProperty); |
638 } | 640 } |
639 } | 641 } |
640 | 642 |
641 void _serializeString(StringLiteral expr) { | 643 void _serializeString(StringLiteral expr) { |
642 if (expr is AdjacentStrings) { | 644 if (expr is AdjacentStrings) { |
643 if (expr.strings.every((string) => string is SimpleStringLiteral)) { | 645 if (expr.strings.every((string) => string is SimpleStringLiteral)) { |
644 operations.add(UnlinkedExprOperation.pushString); | 646 operations.add(UnlinkedExprOperation.pushString); |
645 strings.add(expr.stringValue); | 647 strings.add(expr.stringValue); |
(...skipping 24 matching lines...) Expand all Loading... |
670 if (typeArguments == null) { | 672 if (typeArguments == null) { |
671 ints.add(0); | 673 ints.add(0); |
672 } else { | 674 } else { |
673 ints.add(typeArguments.arguments.length); | 675 ints.add(typeArguments.arguments.length); |
674 for (TypeAnnotation type in typeArguments.arguments) { | 676 for (TypeAnnotation type in typeArguments.arguments) { |
675 references.add(serializeTypeName(type)); | 677 references.add(serializeTypeName(type)); |
676 } | 678 } |
677 } | 679 } |
678 } | 680 } |
679 } | 681 } |
OLD | NEW |