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 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 Loading... |
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 Loading... |
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 } |
OLD | NEW |