Chromium Code Reviews| Index: frog/leg/resolver.dart |
| diff --git a/frog/leg/resolver.dart b/frog/leg/resolver.dart |
| index 0719b23532b118b0a745d247f5e136ca5e7ec904..144c080424de59d5ce78169aa28a0e9a8fb2c6e8 100644 |
| --- a/frog/leg/resolver.dart |
| +++ b/frog/leg/resolver.dart |
| @@ -489,7 +489,19 @@ class FullResolverVisitor extends ResolverVisitor { |
| } |
| visitForInStatement(ForInStatement node) { |
| - cancel(node, 'unimplemented'); |
| + visit(node.expression); |
| + Scope scope = new BlockScope(context); |
| + Node declaration = node.declaredIdentifier; |
| + visitIn(declaration, scope); |
| + visitIn(node.body, scope); |
| + if (declaration is !VariableDefinitions || |
| + !declaration.definitions.nodes.tail.isEmpty()) { |
| + // The variable declaration is either not a declaration, or it's |
| + // declaring more than one variable. |
| + // TODO(lrn): A non-terminating error report would be fine here. |
|
ngeoffray
2012/01/11 10:09:22
TODO(lrn): Must change cancel to error.
Is error
Lasse Reichstein
2012/01/11 10:26:00
No, I was guessing that cancel was the right thing
|
| + print(declaration); |
|
ngeoffray
2012/01/11 10:09:22
Remove print.
Lasse Reichstein
2012/01/11 10:26:00
Done.
|
| + cancel(node.declaredIdentifier, "Invalid variable declaration"); |
| + } |
| } |
| visitLabelledStatement(LabelledStatement node) { |