| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 671 |
| 672 visitBlock(Block node) { | 672 visitBlock(Block node) { |
| 673 visitIn(node.statements, new BlockScope(context)); | 673 visitIn(node.statements, new BlockScope(context)); |
| 674 } | 674 } |
| 675 | 675 |
| 676 visitDoWhile(DoWhile node) { | 676 visitDoWhile(DoWhile node) { |
| 677 visitLoopBodyIn(node, node.body, new BlockScope(context)); | 677 visitLoopBodyIn(node, node.body, new BlockScope(context)); |
| 678 visit(node.condition); | 678 visit(node.condition); |
| 679 } | 679 } |
| 680 | 680 |
| 681 visitEmptyStatement(EmptyStatement node) { } |
| 682 |
| 681 visitExpressionStatement(ExpressionStatement node) { | 683 visitExpressionStatement(ExpressionStatement node) { |
| 682 visit(node.expression); | 684 visit(node.expression); |
| 683 } | 685 } |
| 684 | 686 |
| 685 visitFor(For node) { | 687 visitFor(For node) { |
| 686 Scope scope = new BlockScope(context); | 688 Scope scope = new BlockScope(context); |
| 687 visitIn(node.initializer, scope); | 689 visitIn(node.initializer, scope); |
| 688 visitIn(node.condition, scope); | 690 visitIn(node.condition, scope); |
| 689 visitIn(node.update, scope); | 691 visitIn(node.update, scope); |
| 690 visitLoopBodyIn(node, node.body, scope); | 692 visitLoopBodyIn(node, node.body, scope); |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 class TopScope extends Scope { | 1427 class TopScope extends Scope { |
| 1426 LibraryElement get library() => element; | 1428 LibraryElement get library() => element; |
| 1427 | 1429 |
| 1428 TopScope(LibraryElement library) : super(null, library); | 1430 TopScope(LibraryElement library) : super(null, library); |
| 1429 Element lookup(SourceString name) => library.find(name); | 1431 Element lookup(SourceString name) => library.find(name); |
| 1430 | 1432 |
| 1431 Element add(Element element) { | 1433 Element add(Element element) { |
| 1432 throw "Cannot add an element in the top scope"; | 1434 throw "Cannot add an element in the top scope"; |
| 1433 } | 1435 } |
| 1434 } | 1436 } |
| OLD | NEW |