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

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

Issue 11021008: Added 'dynamic' keyword, so that 'Dynamic' can be deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated dart2dart test status file with co19 issue as well. Created 8 years, 2 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 abstract class TreeElements { 5 abstract class TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 DartType getType(TypeAnnotation annotation); 8 DartType getType(TypeAnnotation annotation);
9 bool isParameterChecked(Element element); 9 bool isParameterChecked(Element element);
10 } 10 }
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 Send send = node.typeName.asSend(); 977 Send send = node.typeName.asSend();
978 return resolveTypeNameInternal(scope, typeName, send); 978 return resolveTypeNameInternal(scope, typeName, send);
979 } 979 }
980 980
981 Element resolveTypeNameInternal(Scope scope, Identifier typeName, Send send) { 981 Element resolveTypeNameInternal(Scope scope, Identifier typeName, Send send) {
982 if (send !== null) { 982 if (send !== null) {
983 typeName = send.selector; 983 typeName = send.selector;
984 } 984 }
985 if (typeName.source.stringValue === 'void') { 985 if (typeName.source.stringValue === 'void') {
986 return compiler.types.voidType.element; 986 return compiler.types.voidType.element;
987 } else if (typeName.source.stringValue === 'Dynamic') { 987 } else if (
988 // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support.
989 typeName.source.stringValue === 'Dynamic'
990 || typeName.source.stringValue === 'dynamic') {
988 return compiler.dynamicClass; 991 return compiler.dynamicClass;
989 } else if (send !== null) { 992 } else if (send !== null) {
990 Element e = scope.lookup(send.receiver.asIdentifier().source); 993 Element e = scope.lookup(send.receiver.asIdentifier().source);
991 if (e !== null && e.kind === ElementKind.PREFIX) { 994 if (e !== null && e.kind === ElementKind.PREFIX) {
992 // The receiver is a prefix. Lookup in the imported members. 995 // The receiver is a prefix. Lookup in the imported members.
993 PrefixElement prefix = e; 996 PrefixElement prefix = e;
994 return prefix.lookupLocalMember(typeName.source); 997 return prefix.lookupLocalMember(typeName.source);
995 } else if (e !== null && e.kind === ElementKind.CLASS) { 998 } else if (e !== null && e.kind === ElementKind.CLASS) {
996 // The receiver is the class part of a named constructor. 999 // The receiver is the class part of a named constructor.
997 return e; 1000 return e;
(...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 return result; 3142 return result;
3140 } 3143 }
3141 Element lookup(SourceString name) => localLookup(name); 3144 Element lookup(SourceString name) => localLookup(name);
3142 Element lexicalLookup(SourceString name) => localLookup(name); 3145 Element lexicalLookup(SourceString name) => localLookup(name);
3143 3146
3144 Element add(Element newElement) { 3147 Element add(Element newElement) {
3145 throw "Cannot add an element in a patch library scope"; 3148 throw "Cannot add an element in a patch library scope";
3146 } 3149 }
3147 String toString() => 'PatchLibraryScope($origin,$patch)'; 3150 String toString() => 'PatchLibraryScope($origin,$patch)';
3148 } 3151 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/placeholder_collector.dart ('k') | lib/compiler/implementation/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698