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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2951033004: Implement type inference for conventional for-loops. (Closed)
Patch Set: Created 3 years, 5 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/front_end/lib/src/fasta/kernel/kernel_shadow_ast.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) 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 fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show 8 show
9 FastaMessage, 9 FastaMessage,
10 codeConstFieldWithoutInitializer, 10 codeConstFieldWithoutInitializer,
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 } else { 1503 } else {
1504 return internalError("Unhandled: ${variableOrExpression.runtimeType}"); 1504 return internalError("Unhandled: ${variableOrExpression.runtimeType}");
1505 } 1505 }
1506 exitLocalScope(); 1506 exitLocalScope();
1507 JumpTarget continueTarget = exitContinueTarget(); 1507 JumpTarget continueTarget = exitContinueTarget();
1508 JumpTarget breakTarget = exitBreakTarget(); 1508 JumpTarget breakTarget = exitBreakTarget();
1509 if (continueTarget.hasUsers) { 1509 if (continueTarget.hasUsers) {
1510 body = new LabeledStatement(body); 1510 body = new LabeledStatement(body);
1511 continueTarget.resolveContinues(body); 1511 continueTarget.resolveContinues(body);
1512 } 1512 }
1513 Statement result = new ForStatement(variables, condition, updates, body); 1513 Statement result =
1514 new KernelForStatement(variables, condition, updates, body);
1514 if (begin != null) { 1515 if (begin != null) {
1515 result = new Block(<Statement>[begin, result]); 1516 result = new Block(<Statement>[begin, result]);
1516 } 1517 }
1517 if (breakTarget.hasUsers) { 1518 if (breakTarget.hasUsers) {
1518 result = new LabeledStatement(result); 1519 result = new LabeledStatement(result);
1519 breakTarget.resolveBreaks(result); 1520 breakTarget.resolveBreaks(result);
1520 } 1521 }
1521 exitLoopOrSwitch(result); 1522 exitLoopOrSwitch(result);
1522 } 1523 }
1523 1524
(...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 if (starToken == null) { 3687 if (starToken == null) {
3687 return AsyncMarker.Async; 3688 return AsyncMarker.Async;
3688 } else { 3689 } else {
3689 assert(identical(starToken.stringValue, "*")); 3690 assert(identical(starToken.stringValue, "*"));
3690 return AsyncMarker.AsyncStar; 3691 return AsyncMarker.AsyncStar;
3691 } 3692 }
3692 } else { 3693 } else {
3693 return internalError("Unknown async modifier: $asyncToken"); 3694 return internalError("Unknown async modifier: $asyncToken");
3694 } 3695 }
3695 } 3696 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698