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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2962583002: Add type inference for break and continue statements. (Closed)
Patch Set: 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
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 87f4778fe8da8db0f8b4d4ebec27b818ff46d505..d0ae090c021e9dd2ea8352671e22b52a3e1e8a70 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -171,6 +171,19 @@ class KernelBoolLiteral extends BoolLiteral implements KernelExpression {
}
}
+/// Concrete shadow object representing a break or continue statement in kernel
+/// form.
+class KernelBreakStatement extends BreakStatement implements KernelStatement {
+ KernelBreakStatement(LabeledStatement target) : super(target);
+
+ @override
+ void _inferStatement(KernelTypeInferrer inferrer) {
+ inferrer.listener.breakStatementEnter(this);
+ // No inference needs to be done.
+ inferrer.listener.breakStatementExit(this);
+ }
+}
+
/// Concrete shadow object representing a cascade expression.
///
/// A cascade expression of the form `a..b()..c()` is represented as the kernel
@@ -500,6 +513,20 @@ class KernelConstructorInvocation extends ConstructorInvocation
}
}
+/// Concrete shadow object representing a continue statement from a switch
+/// statement, in kernel form.
+class KernelContinueSwitchStatement extends ContinueSwitchStatement
+ implements KernelStatement {
+ KernelContinueSwitchStatement(SwitchCase target) : super(target);
+
+ @override
+ void _inferStatement(KernelTypeInferrer inferrer) {
+ inferrer.listener.continueSwitchStatementEnter(this);
+ // No inference needs to be done.
+ inferrer.listener.continueSwitchStatementExit(this);
+ }
+}
+
/// Concrete implementation of [DependencyCollector] specialized to work with
/// kernel objects.
class KernelDependencyCollector extends DependencyCollectorImpl {

Powered by Google App Engine
This is Rietveld 408576698