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

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, 11 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) 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 visit(node.send.argumentsNode); 644 visit(node.send.argumentsNode);
645 645
646 SourceString constructorName; 646 SourceString constructorName;
647 Node typeName = node.send.selector.asTypeAnnotation().typeName; 647 Node typeName = node.send.selector.asTypeAnnotation().typeName;
648 if (typeName.asSend() !== null) { 648 if (typeName.asSend() !== null) {
649 Identifier receiver = typeName.asSend().receiver.asIdentifier(); 649 Identifier receiver = typeName.asSend().receiver.asIdentifier();
650 Identifier selector = typeName.asSend().selector.asIdentifier(); 650 Identifier selector = typeName.asSend().selector.asIdentifier();
651 SourceString className = receiver.source; 651 SourceString className = receiver.source;
652 SourceString name = selector.source; 652 SourceString name = selector.source;
653 constructorName = new SourceString('$className.$name'); 653 constructorName = Elements.constructConstructorName(className, name);
Lasse Reichstein Nielsen 2012/01/27 09:42:34 You are mangling the name here, right? How about n
ngeoffray 2012/01/27 10:50:04 No I'm not mangling it. I'm making it a single Sou
654 } else { 654 } else {
655 constructorName = typeName.asIdentifier().source; 655 constructorName = typeName.asIdentifier().source;
656 } 656 }
657 ClassElement cls = resolveTypeRequired(node.send.selector); 657 ClassElement cls = resolveTypeRequired(node.send.selector);
658 Element constructor = null; 658 Element constructor = null;
659 if (cls !== null) { 659 if (cls !== null) {
660 constructor = cls.resolve(compiler).lookupConstructor(constructorName); 660 constructor = cls.resolve(compiler).lookupConstructor(constructorName);
661 if (constructorName == cls.name 661 if (constructorName == cls.name
662 && constructor === null 662 && constructor === null
663 && node.send.argumentsNode.isEmpty()) { 663 && node.send.argumentsNode.isEmpty()) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 class TopScope extends Scope { 999 class TopScope extends Scope {
1000 Universe universe; 1000 Universe universe;
1001 1001
1002 TopScope(Universe this.universe) : super(null, null); 1002 TopScope(Universe this.universe) : super(null, null);
1003 Element lookup(SourceString name) => universe.find(name); 1003 Element lookup(SourceString name) => universe.find(name);
1004 1004
1005 Element add(Element element) { 1005 Element add(Element element) {
1006 throw "Cannot add an element in the top scope"; 1006 throw "Cannot add an element in the top scope";
1007 } 1007 }
1008 } 1008 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698