| 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/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 int doublePtr = 0; | 255 int doublePtr = 0; |
| 256 int stringPtr = 0; | 256 int stringPtr = 0; |
| 257 int refPtr = 0; | 257 int refPtr = 0; |
| 258 final List<Expression> stack = <Expression>[]; | 258 final List<Expression> stack = <Expression>[]; |
| 259 | 259 |
| 260 _ConstExprBuilder(this.resynthesizer, this.uc); | 260 _ConstExprBuilder(this.resynthesizer, this.uc); |
| 261 | 261 |
| 262 Expression get expr => stack.single; | 262 Expression get expr => stack.single; |
| 263 | 263 |
| 264 Expression build() { | 264 Expression build() { |
| 265 // TODO(scheglov) complete implementation | 265 if (uc.isInvalid) { |
| 266 return AstFactory.identifier3(r'$$invalidConstExpr$$'); |
| 267 } |
| 266 for (UnlinkedConstOperation operation in uc.operations) { | 268 for (UnlinkedConstOperation operation in uc.operations) { |
| 267 switch (operation) { | 269 switch (operation) { |
| 268 case UnlinkedConstOperation.pushNull: | 270 case UnlinkedConstOperation.pushNull: |
| 269 _push(AstFactory.nullLiteral()); | 271 _push(AstFactory.nullLiteral()); |
| 270 break; | 272 break; |
| 271 // bool | 273 // bool |
| 272 case UnlinkedConstOperation.pushFalse: | 274 case UnlinkedConstOperation.pushFalse: |
| 273 _push(AstFactory.booleanLiteral(false)); | 275 _push(AstFactory.booleanLiteral(false)); |
| 274 break; | 276 break; |
| 275 case UnlinkedConstOperation.pushTrue: | 277 case UnlinkedConstOperation.pushTrue: |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 } | 1936 } |
| 1935 : () => this.element; | 1937 : () => this.element; |
| 1936 // TODO(paulberry): Is it a bug that we have to pass `false` for | 1938 // TODO(paulberry): Is it a bug that we have to pass `false` for |
| 1937 // isInstantiated? | 1939 // isInstantiated? |
| 1938 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); | 1940 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); |
| 1939 } else { | 1941 } else { |
| 1940 return null; | 1942 return null; |
| 1941 } | 1943 } |
| 1942 } | 1944 } |
| 1943 } | 1945 } |
| OLD | NEW |