| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 } | 8 } |
| 9 | 9 |
| 10 class TreeElementMapping implements TreeElements { | 10 class TreeElementMapping implements TreeElements { |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 } | 1075 } |
| 1076 target = label.target; | 1076 target = label.target; |
| 1077 if (!target.statement.isValidContinueTarget()) { | 1077 if (!target.statement.isValidContinueTarget()) { |
| 1078 error(node.target, MessageKind.INVALID_CONTINUE, [labelName]); | 1078 error(node.target, MessageKind.INVALID_CONTINUE, [labelName]); |
| 1079 } | 1079 } |
| 1080 label.setContinueTarget(); | 1080 label.setContinueTarget(); |
| 1081 } | 1081 } |
| 1082 mapping[node] = target; | 1082 mapping[node] = target; |
| 1083 } | 1083 } |
| 1084 | 1084 |
| 1085 visitForInStatement(ForInStatement node) { | 1085 visitForIn(ForIn node) { |
| 1086 visit(node.expression); | 1086 visit(node.expression); |
| 1087 Scope scope = new BlockScope(context); | 1087 Scope scope = new BlockScope(context); |
| 1088 Node declaration = node.declaredIdentifier; | 1088 Node declaration = node.declaredIdentifier; |
| 1089 visitIn(declaration, scope); | 1089 visitIn(declaration, scope); |
| 1090 visitLoopBodyIn(node, node.body, scope); | 1090 visitLoopBodyIn(node, node.body, scope); |
| 1091 | 1091 |
| 1092 // TODO(lrn): Also allow a single identifier. | 1092 // TODO(lrn): Also allow a single identifier. |
| 1093 if ((declaration is !Send || declaration.asSend().selector is !Identifier) | 1093 if ((declaration is !Send || declaration.asSend().selector is !Identifier) |
| 1094 && (declaration is !VariableDefinitions || | 1094 && (declaration is !VariableDefinitions || |
| 1095 !declaration.asVariableDefinitions().definitions.nodes.tail.isEmpty())) | 1095 !declaration.asVariableDefinitions().definitions.nodes.tail.isEmpty())) |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 | 1791 |
| 1792 TopScope(LibraryElement library) : super(null, library); | 1792 TopScope(LibraryElement library) : super(null, library); |
| 1793 Element lookup(SourceString name) { | 1793 Element lookup(SourceString name) { |
| 1794 return library.find(name); | 1794 return library.find(name); |
| 1795 } | 1795 } |
| 1796 | 1796 |
| 1797 Element add(Element element) { | 1797 Element add(Element element) { |
| 1798 throw "Cannot add an element in the top scope"; | 1798 throw "Cannot add an element in the top scope"; |
| 1799 } | 1799 } |
| 1800 } | 1800 } |
| OLD | NEW |