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

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

Issue 9112012: Implement code generation for === and !==. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a bug and update status files. 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 class TreeElements { 5 class TreeElements {
6 Map<Node, Element> map; 6 Map<Node, Element> map;
7 TreeElements() : map = new LinkedHashMap<Node, Element>(); 7 TreeElements() : map = new LinkedHashMap<Node, Element>();
8 operator []=(Node node, Element element) => map[node] = element; 8 operator []=(Node node, Element element) => map[node] = element;
9 operator [](Node node) => map[node]; 9 operator [](Node node) => map[node];
10 } 10 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 SourceString name = cls.name; 442 SourceString name = cls.name;
443 constructor = cls.resolve(compiler).lookupConstructor(name); 443 constructor = cls.resolve(compiler).lookupConstructor(name);
444 if (name == cls.name 444 if (name == cls.name
445 && constructor === null 445 && constructor === null
446 && node.send.argumentsNode.isEmpty()) { 446 && node.send.argumentsNode.isEmpty()) {
447 constructor = cls.getSynthesizedConstructor(); 447 constructor = cls.getSynthesizedConstructor();
448 } 448 }
449 if (constructor === null) { 449 if (constructor === null) {
450 error(node, MessageKind.CANNOT_FIND_CONSTRUCTOR, [node]); 450 error(node, MessageKind.CANNOT_FIND_CONSTRUCTOR, [node]);
451 } 451 }
452 } else {
453 Node selector = node.send.selector;
454 error(selector, MessageKind.CANNOT_RESOLVE_TYPE, [selector]);
452 } 455 }
453 456
454 useElement(node.send, constructor); 457 useElement(node.send, constructor);
455 return null; 458 return null;
456 } 459 }
457 460
458 visitModifiers(Modifiers node) { 461 visitModifiers(Modifiers node) {
459 // TODO(ngeoffray): Implement this. 462 // TODO(ngeoffray): Implement this.
460 cancel(node, 'unimplemented'); 463 cancel(node, 'unimplemented');
461 } 464 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 class TopScope extends Scope { 716 class TopScope extends Scope {
714 Universe universe; 717 Universe universe;
715 718
716 TopScope(Universe this.universe) : super(null, null); 719 TopScope(Universe this.universe) : super(null, null);
717 Element lookup(SourceString name) => universe.find(name); 720 Element lookup(SourceString name) => universe.find(name);
718 721
719 Element add(Element element) { 722 Element add(Element element) {
720 throw "Cannot add an element in the top scope"; 723 throw "Cannot add an element in the top scope";
721 } 724 }
722 } 725 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698