Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1681513003: Resynthesize invalid constants as unresolved identifiers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698