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

Unified Diff: frog/leg/typechecker.dart

Issue 9421035: Support break and labeled statements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 10 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: frog/leg/typechecker.dart
diff --git a/frog/leg/typechecker.dart b/frog/leg/typechecker.dart
index db4df503ea0f19cd4eb389d2dac58664ff90be25..732880a44c1462f235ec749f585e4237297419a4 100644
--- a/frog/leg/typechecker.dart
+++ b/frog/leg/typechecker.dart
@@ -587,7 +587,7 @@ class TypeCheckerVisitor implements Visitor<Type> {
}
visitBreakStatement(BreakStatement node) {
- compiler.unimplemented('visitBreakStatement', node: node);
+ return StatementType.NOT_RETURNING;
}
visitContinueStatement(ContinueStatement node) {
@@ -595,11 +595,13 @@ class TypeCheckerVisitor implements Visitor<Type> {
}
visitForInStatement(ForInStatement node) {
- node.visitChildren(this);
+ analyze(node.expression);
+ StatementType bodyType = analyze(node.body);
+ return bodyType.join(StatementType.NOT_RETURNING);
}
visitLabelledStatement(LabelledStatement node) {
- compiler.unimplemented('visitLabelledStatement', node: node);
+ return node.statement.accept(this);
}
visitLiteralMap(LiteralMap node) {

Powered by Google App Engine
This is Rietveld 408576698