| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 int doublePtr = 0; | 279 int doublePtr = 0; |
| 280 int stringPtr = 0; | 280 int stringPtr = 0; |
| 281 int refPtr = 0; | 281 int refPtr = 0; |
| 282 final List<Expression> stack = <Expression>[]; | 282 final List<Expression> stack = <Expression>[]; |
| 283 | 283 |
| 284 _ConstExprBuilder(this.resynthesizer, this.uc); | 284 _ConstExprBuilder(this.resynthesizer, this.uc); |
| 285 | 285 |
| 286 Expression get expr => stack.single; | 286 Expression get expr => stack.single; |
| 287 | 287 |
| 288 Expression build() { | 288 Expression build() { |
| 289 if (uc.isInvalid) { | 289 if (!uc.isValidConst) { |
| 290 return AstFactory.identifier3(r'$$invalidConstExpr$$'); | 290 return AstFactory.identifier3(r'$$invalidConstExpr$$'); |
| 291 } | 291 } |
| 292 for (UnlinkedConstOperation operation in uc.operations) { | 292 for (UnlinkedConstOperation operation in uc.operations) { |
| 293 switch (operation) { | 293 switch (operation) { |
| 294 case UnlinkedConstOperation.pushNull: | 294 case UnlinkedConstOperation.pushNull: |
| 295 _push(AstFactory.nullLiteral()); | 295 _push(AstFactory.nullLiteral()); |
| 296 break; | 296 break; |
| 297 // bool | 297 // bool |
| 298 case UnlinkedConstOperation.pushFalse: | 298 case UnlinkedConstOperation.pushFalse: |
| 299 _push(AstFactory.booleanLiteral(false)); | 299 _push(AstFactory.booleanLiteral(false)); |
| (...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 static String _getElementIdentifier(String name, ReferenceKind kind) { | 2639 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 2640 if (kind == ReferenceKind.topLevelPropertyAccessor || | 2640 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 2641 kind == ReferenceKind.propertyAccessor) { | 2641 kind == ReferenceKind.propertyAccessor) { |
| 2642 if (!name.endsWith('=')) { | 2642 if (!name.endsWith('=')) { |
| 2643 return name + '?'; | 2643 return name + '?'; |
| 2644 } | 2644 } |
| 2645 } | 2645 } |
| 2646 return name; | 2646 return name; |
| 2647 } | 2647 } |
| 2648 } | 2648 } |
| OLD | NEW |