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

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

Issue 9368033: Support is checks on primitive types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
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 | « dart/frog/leg/lib/core.dart ('k') | dart/frog/leg/ssa/codegen.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 } 8 }
9 9
10 class TreeElementMapping implements TreeElements { 10 class TreeElementMapping implements TreeElements {
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 if (target == null) { 569 if (target == null) {
570 error(node, MessageKind.NO_SUCH_LIBRARY_MEMBER, 570 error(node, MessageKind.NO_SUCH_LIBRARY_MEMBER,
571 [resolvedReceiver.name, name]); 571 [resolvedReceiver.name, name]);
572 } 572 }
573 } 573 }
574 } 574 }
575 return target; 575 return target;
576 } 576 }
577 577
578 resolveTypeTest(TypeAnnotation node) { 578 resolveTypeTest(TypeAnnotation node) {
579 ClassElement cls = resolveTypeRequired(node); 579 resolveTypeRequired(node);
580 if (cls.name == const SourceString('String') ||
581 cls.name == const SourceString('List') ||
582 cls.name == const SourceString('int') ||
583 cls.name == const SourceString('num') ||
584 cls.name == const SourceString('double')) {
585 cancel(node, "type test for ${cls.name} is not implemented");
586 }
587 } 580 }
588 581
589 void handleArguments(Send node) { 582 void handleArguments(Send node) {
590 int count = 0; 583 int count = 0;
591 List<SourceString> namedArguments = <SourceString>[]; 584 List<SourceString> namedArguments = <SourceString>[];
592 for (Link<Node> link = node.argumentsNode.nodes; 585 for (Link<Node> link = node.argumentsNode.nodes;
593 !link.isEmpty(); 586 !link.isEmpty();
594 link = link.tail) { 587 link = link.tail) {
595 count++; 588 count++;
596 Expression argument = link.head; 589 Expression argument = link.head;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 class TopScope extends Scope { 1149 class TopScope extends Scope {
1157 LibraryElement get library() => element; 1150 LibraryElement get library() => element;
1158 1151
1159 TopScope(LibraryElement library) : super(null, library); 1152 TopScope(LibraryElement library) : super(null, library);
1160 Element lookup(SourceString name) => library.find(name); 1153 Element lookup(SourceString name) => library.find(name);
1161 1154
1162 Element add(Element element) { 1155 Element add(Element element) {
1163 throw "Cannot add an element in the top scope"; 1156 throw "Cannot add an element in the top scope";
1164 } 1157 }
1165 } 1158 }
OLDNEW
« no previous file with comments | « dart/frog/leg/lib/core.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698