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

Unified Diff: pkg/compiler/lib/src/elements/jumps.dart

Issue 2930293002: Parameterize and move JumpTarget/LabelDefition to elements/jumps.dart (Closed)
Patch Set: Fix Created 3 years, 6 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 | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/jumps.dart
diff --git a/pkg/compiler/lib/src/elements/jumps.dart b/pkg/compiler/lib/src/elements/jumps.dart
new file mode 100644
index 0000000000000000000000000000000000000000..65ab8b9d396affea19b98cc9091624ea64f38369
--- /dev/null
+++ b/pkg/compiler/lib/src/elements/jumps.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library elements.jumps;
+
+import 'entities.dart';
+
+/// The label entity defined by a labeled statement.
+abstract class LabelDefinition<T> extends Entity {
+ T get label;
+ String get labelName;
+ JumpTarget<T> get target;
+
+ bool get isTarget;
+ bool get isBreakTarget;
+ bool get isContinueTarget;
+
+ void setBreakTarget();
+ void setContinueTarget();
+}
+
+/// A jump target is the reference point of a statement or switch-case,
+/// either by label or as the default target of a break or continue.
+abstract class JumpTarget<T> extends Local {
+ T get statement;
+ int get nestingLevel;
+ List<LabelDefinition<T>> get labels;
+
+ bool get isTarget;
+ bool get isBreakTarget;
+ bool get isContinueTarget;
+ bool get isSwitch;
+
+ // TODO(kasperl): Try to get rid of these.
+ void set isBreakTarget(bool value);
+ void set isContinueTarget(bool value);
+
+ LabelDefinition<T> addLabel(T label, String labelName);
+}
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698