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

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

Issue 10191016: Introduce typed selectors for getters and setters also for better tree shaking. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 Expression argument = link.head; 863 Expression argument = link.head;
864 visit(argument); 864 visit(argument);
865 if (argument.asNamedArgument() != null) { 865 if (argument.asNamedArgument() != null) {
866 seenNamedArgument = true; 866 seenNamedArgument = true;
867 NamedArgument named = argument; 867 NamedArgument named = argument;
868 namedArguments.add(named.name.source); 868 namedArguments.add(named.name.source);
869 } else if (seenNamedArgument) { 869 } else if (seenNamedArgument) {
870 error(argument, MessageKind.INVALID_ARGUMENT_AFTER_NAMED); 870 error(argument, MessageKind.INVALID_ARGUMENT_AFTER_NAMED);
871 } 871 }
872 } 872 }
873 mapping.setSelector(node, new Invocation(count, namedArguments)); 873 mapping.setSelector(node, new Selector.invocation(count, namedArguments));
874 } 874 }
875 875
876 visitSend(Send node) { 876 visitSend(Send node) {
877 Element target = resolveSend(node); 877 Element target = resolveSend(node);
878 if (node.isOperator) { 878 if (node.isOperator) {
879 Operator op = node.selector.asOperator(); 879 Operator op = node.selector.asOperator();
880 if (op.source.stringValue === 'is') { 880 if (op.source.stringValue === 'is') {
881 resolveTypeTest(node.arguments.head); 881 resolveTypeTest(node.arguments.head);
882 assert(node.arguments.tail.isEmpty()); 882 assert(node.arguments.tail.isEmpty());
883 mapping.setSelector(node, Selector.BINARY_OPERATOR); 883 mapping.setSelector(node, Selector.BINARY_OPERATOR);
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1911
1912 TopScope(LibraryElement library) : super(null, library); 1912 TopScope(LibraryElement library) : super(null, library);
1913 Element lookup(SourceString name) { 1913 Element lookup(SourceString name) {
1914 return library.find(name); 1914 return library.find(name);
1915 } 1915 }
1916 1916
1917 Element add(Element newElement) { 1917 Element add(Element newElement) {
1918 throw "Cannot add an element in the top scope"; 1918 throw "Cannot add an element in the top scope";
1919 } 1919 }
1920 } 1920 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698