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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel_visitor.dart

Issue 2581143003: implement LabeledStatement and Break in kernel (Closed)
Patch Set: fix some tests Created 4 years 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
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 import 'package:kernel/frontend/accessors.dart' 6 import 'package:kernel/frontend/accessors.dart'
7 show 7 show
8 Accessor, 8 Accessor,
9 IndexAccessor, 9 IndexAccessor,
10 NullAwarePropertyAccessor, 10 NullAwarePropertyAccessor,
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 ir.SwitchCase getContinueSwitchTarget(JumpTarget target) { 399 ir.SwitchCase getContinueSwitchTarget(JumpTarget target) {
400 return continueSwitchTargets[target]; 400 return continueSwitchTargets[target];
401 } 401 }
402 402
403 ir.Statement buildBreakTarget( 403 ir.Statement buildBreakTarget(
404 ir.Statement statement, Node node, JumpTarget jumpTarget) { 404 ir.Statement statement, Node node, JumpTarget jumpTarget) {
405 assert(node.isValidBreakTarget()); 405 assert(node.isValidBreakTarget());
406 assert(jumpTarget == elements.getTargetDefinition(node)); 406 assert(jumpTarget == elements.getTargetDefinition(node));
407 associateNode(statement, node);
407 if (jumpTarget != null && jumpTarget.isBreakTarget) { 408 if (jumpTarget != null && jumpTarget.isBreakTarget) {
408 ir.LabeledStatement breakTarget = getBreakTarget(jumpTarget); 409 ir.LabeledStatement breakTarget = getBreakTarget(jumpTarget);
409 breakTarget.body = statement; 410 breakTarget.body = statement;
410 statement.parent = breakTarget; 411 statement.parent = breakTarget;
411 return breakTarget; 412 return breakTarget;
412 } else { 413 } else {
413 return statement; 414 return statement;
414 } 415 }
415 } 416 }
416 417
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 : this(null, true, node, initializers); 2847 : this(null, true, node, initializers);
2847 2848
2848 accept(ir.Visitor v) => throw "unsupported"; 2849 accept(ir.Visitor v) => throw "unsupported";
2849 2850
2850 visitChildren(ir.Visitor v) => throw "unsupported"; 2851 visitChildren(ir.Visitor v) => throw "unsupported";
2851 2852
2852 String toString() { 2853 String toString() {
2853 return "IrFunction($kind, $isConstructor, $node, $initializers)"; 2854 return "IrFunction($kind, $isConstructor, $node, $initializers)";
2854 } 2855 }
2855 } 2856 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698