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

Side by Side 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, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/dart_backend.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer2dart.cps_generator; 5 library analyzer2dart.cps_generator;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 8
9 import 'package:compiler/implementation/dart_types.dart' as dart2js; 9 import 'package:compiler/implementation/dart_types.dart' as dart2js;
10 import 'package:compiler/implementation/elements/elements.dart' as dart2js; 10 import 'package:compiler/implementation/elements/elements.dart' as dart2js;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 irBuilder.buildIf( 295 irBuilder.buildIf(
296 build(node.condition), 296 build(node.condition),
297 subbuild(node.thenStatement), 297 subbuild(node.thenStatement),
298 subbuild(node.elseStatement)); 298 subbuild(node.elseStatement));
299 } 299 }
300 300
301 @override 301 @override
302 visitBlock(Block node) { 302 visitBlock(Block node) {
303 irBuilder.buildBlock(node.statements, build); 303 irBuilder.buildBlock(node.statements, build);
304 } 304 }
305
306 @override
307 visitForStatement(ForStatement node) {
308 // TODO(johnniwinther): Support `for` as a jump target.
309 SubbuildFunction buildInitializer;
310 if (node.variables != null) {
311 buildInitializer = subbuild(node.variables);
312 } else {
313 buildInitializer = subbuild(node.initialization);
314 }
315 irBuilder.buildFor(buildInitializer: buildInitializer,
316 buildCondition: subbuild(node.condition),
317 buildBody: subbuild(node.body),
318 buildUpdate: subbuildSequence(node.updaters));
319 }
305 } 320 }
OLDNEW
« 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