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

Unified Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 683803003: Support for loops in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/dart_backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/lib/src/cps_generator.dart
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 9601cb82087a4efc85fb7c9db9b3dd45b93e3bcb..a8c7698a88efa3462f72e5910877e925e2173a0b 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -302,4 +302,19 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
visitBlock(Block node) {
irBuilder.buildBlock(node.statements, build);
}
+
+ @override
+ visitForStatement(ForStatement node) {
+ // TODO(johnniwinther): Support `for` as a jump target.
+ SubbuildFunction buildInitializer;
+ if (node.variables != null) {
+ buildInitializer = subbuild(node.variables);
+ } else {
+ buildInitializer = subbuild(node.initialization);
+ }
+ irBuilder.buildFor(buildInitializer: buildInitializer,
+ buildCondition: subbuild(node.condition),
+ buildBody: subbuild(node.body),
+ buildUpdate: subbuildSequence(node.updaters));
+ }
}
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/dart_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698