| 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 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 visitCatchBlock(CatchBlock node) { | 1741 visitCatchBlock(CatchBlock node) { |
| 1742 Scope blockScope = new BlockScope(scope); | 1742 Scope blockScope = new BlockScope(scope); |
| 1743 if (node.formals.isEmpty()) { | 1743 if (node.formals.isEmpty()) { |
| 1744 error(node, MessageKind.EMPTY_CATCH_DECLARATION); | 1744 error(node, MessageKind.EMPTY_CATCH_DECLARATION); |
| 1745 } else if (!node.formals.nodes.tail.isEmpty() | 1745 } else if (!node.formals.nodes.tail.isEmpty() |
| 1746 && !node.formals.nodes.tail.tail.isEmpty()) { | 1746 && !node.formals.nodes.tail.tail.isEmpty()) { |
| 1747 for (Node extra in node.formals.nodes.tail.tail) { | 1747 for (Node extra in node.formals.nodes.tail.tail) { |
| 1748 error(extra, MessageKind.EXTRA_CATCH_DECLARATION); | 1748 error(extra, MessageKind.EXTRA_CATCH_DECLARATION); |
| 1749 } | 1749 } |
| 1750 } | 1750 } |
| 1751 visitIn(node.type, blockScope); |
| 1751 visitIn(node.formals, blockScope); | 1752 visitIn(node.formals, blockScope); |
| 1752 visitIn(node.block, blockScope); | 1753 visitIn(node.block, blockScope); |
| 1753 } | 1754 } |
| 1754 | 1755 |
| 1755 visitTypedef(Typedef node) { | 1756 visitTypedef(Typedef node) { |
| 1756 unimplemented(node, 'typedef'); | 1757 unimplemented(node, 'typedef'); |
| 1757 } | 1758 } |
| 1758 } | 1759 } |
| 1759 | 1760 |
| 1760 class TypeDefinitionVisitor extends CommonResolverVisitor<Type> { | 1761 class TypeDefinitionVisitor extends CommonResolverVisitor<Type> { |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2458 TopScope(LibraryElement library) : super(null, library); | 2459 TopScope(LibraryElement library) : super(null, library); |
| 2459 Element lookup(SourceString name) { | 2460 Element lookup(SourceString name) { |
| 2460 return library.find(name); | 2461 return library.find(name); |
| 2461 } | 2462 } |
| 2462 | 2463 |
| 2463 Element add(Element newElement) { | 2464 Element add(Element newElement) { |
| 2464 throw "Cannot add an element in the top scope"; | 2465 throw "Cannot add an element in the top scope"; |
| 2465 } | 2466 } |
| 2466 String toString() => '$element'; | 2467 String toString() => '$element'; |
| 2467 } | 2468 } |
| OLD | NEW |