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