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

Side by Side Diff: dart/lib/compiler/implementation/resolver.dart

Issue 10857013: Support for new catch syntax in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/keyword.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698