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

Side by Side Diff: pkg/compiler/lib/src/elements/jumps.dart

Issue 3009463002: Handle labelled continue statements (Closed)
Patch Set: Updated cf. comments Created 3 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 elements.jumps; 5 library elements.jumps;
6 6
7 import 'entities.dart'; 7 import 'entities.dart';
8 8
9 /// The label entity defined by a labeled statement. 9 /// The label entity defined by a labeled statement.
10 abstract class LabelDefinition<T> extends Entity { 10 abstract class LabelDefinition<T> extends Entity {
11 T get label;
12 String get labelName; 11 String get labelName;
13 JumpTarget<T> get target; 12 JumpTarget<T> get target;
14 13
15 bool get isTarget => isBreakTarget || isContinueTarget; 14 bool get isTarget => isBreakTarget || isContinueTarget;
16 15
17 bool get isBreakTarget; 16 bool get isBreakTarget;
18 bool get isContinueTarget; 17 bool get isContinueTarget;
19 } 18 }
20 19
21 /// A jump target is the reference point of a statement or switch-case, 20 /// A jump target is the reference point of a statement or switch-case,
22 /// either by label or as the default target of a break or continue. 21 /// either by label or as the default target of a break or continue.
23 abstract class JumpTarget<T> extends Local { 22 abstract class JumpTarget<T> extends Local {
24 String get name => 'target'; 23 String get name => 'target';
25 24
26 bool get isTarget => isBreakTarget || isContinueTarget; 25 bool get isTarget => isBreakTarget || isContinueTarget;
27 26
28 T get statement; 27 T get statement;
29 int get nestingLevel; 28 int get nestingLevel;
30 List<LabelDefinition<T>> get labels; 29 List<LabelDefinition<T>> get labels;
31 30
32 bool get isBreakTarget; 31 bool get isBreakTarget;
33 bool get isContinueTarget; 32 bool get isContinueTarget;
34 bool get isSwitch; 33 bool get isSwitch;
34 bool get isSwitchCase;
35 35
36 LabelDefinition<T> addLabel(covariant T label, String labelName, 36 LabelDefinition<T> addLabel(covariant T label, String labelName,
37 {bool isBreakTarget: false}); 37 {bool isBreakTarget: false, bool isContinueTarget: false});
38 } 38 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698