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

Side by Side Diff: frog/leg/resolver.dart

Issue 9284022: Operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | « frog/leg/namer.dart ('k') | frog/leg/scanner/class_element_parser.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 } 7 }
8 8
9 class TreeElementMapping implements TreeElements { 9 class TreeElementMapping implements TreeElements {
10 Map<Node, Element> map; 10 Map<Node, Element> map;
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 645
646 visit(node.send.argumentsNode); 646 visit(node.send.argumentsNode);
647 647
648 SourceString constructorName; 648 SourceString constructorName;
649 Node typeName = node.send.selector.asTypeAnnotation().typeName; 649 Node typeName = node.send.selector.asTypeAnnotation().typeName;
650 if (typeName.asSend() !== null) { 650 if (typeName.asSend() !== null) {
651 Identifier receiver = typeName.asSend().receiver.asIdentifier(); 651 Identifier receiver = typeName.asSend().receiver.asIdentifier();
652 Identifier selector = typeName.asSend().selector.asIdentifier(); 652 Identifier selector = typeName.asSend().selector.asIdentifier();
653 SourceString className = receiver.source; 653 SourceString className = receiver.source;
654 SourceString name = selector.source; 654 SourceString name = selector.source;
655 constructorName = new SourceString('$className.$name'); 655 constructorName = Elements.constructConstructorName(className, name);
656 } else { 656 } else {
657 constructorName = typeName.asIdentifier().source; 657 constructorName = typeName.asIdentifier().source;
658 } 658 }
659 ClassElement cls = resolveTypeRequired(node.send.selector); 659 ClassElement cls = resolveTypeRequired(node.send.selector);
660 Element constructor = null; 660 Element constructor = null;
661 if (cls !== null) { 661 if (cls !== null) {
662 constructor = cls.resolve(compiler).lookupConstructor(constructorName); 662 constructor = cls.resolve(compiler).lookupConstructor(constructorName);
663 if (constructorName == cls.name 663 if (constructorName == cls.name
664 && constructor === null 664 && constructor === null
665 && node.send.argumentsNode.isEmpty()) { 665 && node.send.argumentsNode.isEmpty()) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 class TopScope extends Scope { 1004 class TopScope extends Scope {
1005 Universe universe; 1005 Universe universe;
1006 1006
1007 TopScope(Universe this.universe) : super(null, null); 1007 TopScope(Universe this.universe) : super(null, null);
1008 Element lookup(SourceString name) => universe.find(name); 1008 Element lookup(SourceString name) => universe.find(name);
1009 1009
1010 Element add(Element element) { 1010 Element add(Element element) {
1011 throw "Cannot add an element in the top scope"; 1011 throw "Cannot add an element in the top scope";
1012 } 1012 }
1013 } 1013 }
OLDNEW
« no previous file with comments | « frog/leg/namer.dart ('k') | frog/leg/scanner/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698