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

Side by Side Diff: runtime/vm/parser.cc

Issue 9939003: Use null type argument vector instead of vector of Dynamic for a generic raw (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after
2902 unresolved_factory_class.set_factory_signature_class(factory_class); 2902 unresolved_factory_class.set_factory_signature_class(factory_class);
2903 interface.set_factory_class(unresolved_factory_class); 2903 interface.set_factory_class(unresolved_factory_class);
2904 // If a type parameter list is included in the default factory clause (it 2904 // If a type parameter list is included in the default factory clause (it
2905 // can be omitted), verify that it matches the list of type parameters of 2905 // can be omitted), verify that it matches the list of type parameters of
2906 // the interface in number and names. 2906 // the interface in number and names.
2907 if (factory_class.NumTypeParameters() > 0) { 2907 if (factory_class.NumTypeParameters() > 0) {
2908 const TypeArguments& interface_type_parameters = 2908 const TypeArguments& interface_type_parameters =
2909 TypeArguments::Handle(interface.type_parameters()); 2909 TypeArguments::Handle(interface.type_parameters());
2910 const TypeArguments& factory_type_parameters = 2910 const TypeArguments& factory_type_parameters =
2911 TypeArguments::Handle(factory_class.type_parameters()); 2911 TypeArguments::Handle(factory_class.type_parameters());
2912 if (!AbstractTypeArguments::AreEqual(interface_type_parameters, 2912 if (!TypeArguments::AreIdenticalTypeParameters(interface_type_parameters,
2913 factory_type_parameters)) { 2913 factory_type_parameters)) {
2914 const String& interface_name = String::Handle(interface.Name()); 2914 const String& interface_name = String::Handle(interface.Name());
2915 ErrorMsg(factory_name.ident_pos, 2915 ErrorMsg(factory_name.ident_pos,
2916 "mismatch in number or names of type parameters between " 2916 "mismatch in number or names of type parameters between "
2917 "interface '%s' and default factory class '%s'.\n", 2917 "interface '%s' and default factory class '%s'.\n",
2918 interface_name.ToCString(), 2918 interface_name.ToCString(),
2919 factory_name.ident->ToCString()); 2919 factory_name.ident->ToCString());
2920 } 2920 }
2921 } 2921 }
2922 } 2922 }
2923 2923
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 GrowableObjectArray::Handle(GrowableObjectArray::New()); 2998 GrowableObjectArray::Handle(GrowableObjectArray::New());
2999 intptr_t index = 0; 2999 intptr_t index = 0;
3000 AbstractType& type_parameter = TypeParameter::Handle(); 3000 AbstractType& type_parameter = TypeParameter::Handle();
3001 AbstractType& bound = Type::Handle(); 3001 AbstractType& bound = Type::Handle();
3002 do { 3002 do {
3003 ConsumeToken(); 3003 ConsumeToken();
3004 if (CurrentToken() != Token::kIDENT) { 3004 if (CurrentToken() != Token::kIDENT) {
3005 ErrorMsg("type parameter name expected"); 3005 ErrorMsg("type parameter name expected");
3006 } 3006 }
3007 String& type_parameter_name = *CurrentLiteral(); 3007 String& type_parameter_name = *CurrentLiteral();
3008 type_parameter = TypeParameter::New(index, 3008 type_parameter = TypeParameter::New(cls,
3009 index,
3009 type_parameter_name, 3010 type_parameter_name,
3010 token_index_); 3011 token_index_);
3011 ConsumeToken(); 3012 ConsumeToken();
3012 bound = Type::DynamicType(); 3013 bound = Type::DynamicType();
3013 if (CurrentToken() == Token::kEXTENDS) { 3014 if (CurrentToken() == Token::kEXTENDS) {
3014 ConsumeToken(); 3015 ConsumeToken();
3015 // A bound may refer to the owner of the type parameter it applies to, 3016 // A bound may refer to the owner of the type parameter it applies to,
3016 // i.e. to the class or interface currently being parsed. 3017 // i.e. to the class or interface currently being parsed.
3017 // Postpone resolution in order to avoid resolving the class and its 3018 // Postpone resolution in order to avoid resolving the class and its
3018 // type parameters, as they are not fully parsed yet. 3019 // type parameters, as they are not fully parsed yet.
(...skipping 5228 matching lines...) Expand 10 before | Expand all | Expand 10 after
8247 void Parser::SkipQualIdent() { 8248 void Parser::SkipQualIdent() {
8248 ASSERT(IsIdentifier()); 8249 ASSERT(IsIdentifier());
8249 ConsumeToken(); 8250 ConsumeToken();
8250 if (CurrentToken() == Token::kPERIOD) { 8251 if (CurrentToken() == Token::kPERIOD) {
8251 ConsumeToken(); // Consume the kPERIOD token. 8252 ConsumeToken(); // Consume the kPERIOD token.
8252 ExpectIdentifier("identifier expected after '.'"); 8253 ExpectIdentifier("identifier expected after '.'");
8253 } 8254 }
8254 } 8255 }
8255 8256
8256 } // namespace dart 8257 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698