OLD | NEW |
---|---|
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 }; | 220 }; |
221 | 221 |
222 | 222 |
223 void Parser::TryBlocks::AddNodeForFinallyInlining(AstNode* node) { | 223 void Parser::TryBlocks::AddNodeForFinallyInlining(AstNode* node) { |
224 inlined_finally_nodes_.Add(node); | 224 inlined_finally_nodes_.Add(node); |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 // For parsing a compilation unit. | 228 // For parsing a compilation unit. |
229 Parser::Parser(const Script& script, | 229 Parser::Parser(const Script& script, |
230 const Library& library) | 230 const Library& library, |
231 bool generating_snapshot) | |
231 : script_(script), | 232 : script_(script), |
232 tokens_iterator_(TokenStream::Handle(script.tokens()), 0), | 233 tokens_iterator_(TokenStream::Handle(script.tokens()), 0), |
233 token_kind_(Token::kILLEGAL), | 234 token_kind_(Token::kILLEGAL), |
234 current_block_(NULL), | 235 current_block_(NULL), |
235 is_top_level_(false), | 236 is_top_level_(false), |
236 current_member_(NULL), | 237 current_member_(NULL), |
237 allow_function_literals_(true), | 238 allow_function_literals_(true), |
238 current_function_(Function::Handle()), | 239 current_function_(Function::Handle()), |
239 innermost_function_(Function::Handle()), | 240 innermost_function_(Function::Handle()), |
240 current_class_(Class::Handle()), | 241 current_class_(Class::Handle()), |
241 library_(library), | 242 library_(library), |
242 try_blocks_list_(NULL), | 243 try_blocks_list_(NULL), |
243 expression_temp_(NULL) { | 244 expression_temp_(NULL), |
245 class_finalizer_(generating_snapshot) { | |
244 ASSERT(tokens_iterator_.IsValid()); | 246 ASSERT(tokens_iterator_.IsValid()); |
245 ASSERT(!library.IsNull()); | 247 ASSERT(!library.IsNull()); |
246 } | 248 } |
247 | 249 |
248 | 250 |
249 // For parsing a function. | 251 // For parsing a function. |
250 Parser::Parser(const Script& script, | 252 Parser::Parser(const Script& script, |
251 const Function& function, | 253 const Function& function, |
252 intptr_t token_position) | 254 intptr_t token_position) |
253 : script_(script), | 255 : script_(script), |
254 tokens_iterator_(TokenStream::Handle(script.tokens()), token_position), | 256 tokens_iterator_(TokenStream::Handle(script.tokens()), token_position), |
255 token_kind_(Token::kILLEGAL), | 257 token_kind_(Token::kILLEGAL), |
256 current_block_(NULL), | 258 current_block_(NULL), |
257 is_top_level_(false), | 259 is_top_level_(false), |
258 current_member_(NULL), | 260 current_member_(NULL), |
259 allow_function_literals_(true), | 261 allow_function_literals_(true), |
260 current_function_(function), | 262 current_function_(function), |
261 innermost_function_(Function::Handle(function.raw())), | 263 innermost_function_(Function::Handle(function.raw())), |
262 current_class_(Class::Handle(current_function_.Owner())), | 264 current_class_(Class::Handle(current_function_.Owner())), |
263 library_(Library::Handle(current_class_.library())), | 265 library_(Library::Handle(current_class_.library())), |
264 try_blocks_list_(NULL), | 266 try_blocks_list_(NULL), |
265 expression_temp_(NULL) { | 267 expression_temp_(NULL), |
268 class_finalizer_(ClassFinalizer::kNotGeneratingSnapshot) { | |
266 ASSERT(tokens_iterator_.IsValid()); | 269 ASSERT(tokens_iterator_.IsValid()); |
267 ASSERT(!function.IsNull()); | 270 ASSERT(!function.IsNull()); |
268 if (FLAG_enable_type_checks) { | 271 if (FLAG_enable_type_checks) { |
269 EnsureExpressionTemp(); | 272 EnsureExpressionTemp(); |
270 } | 273 } |
271 } | 274 } |
272 | 275 |
273 | 276 |
274 bool Parser::SetAllowFunctionLiterals(bool value) { | 277 bool Parser::SetAllowFunctionLiterals(bool value) { |
275 bool current_value = allow_function_literals_; | 278 bool current_value = allow_function_literals_; |
(...skipping 25 matching lines...) Expand all Loading... | |
301 void Parser::SetPosition(intptr_t position) { | 304 void Parser::SetPosition(intptr_t position) { |
302 if (position < TokenPos() && position != 0) { | 305 if (position < TokenPos() && position != 0) { |
303 CompilerStats::num_tokens_rewind += (TokenPos() - position); | 306 CompilerStats::num_tokens_rewind += (TokenPos() - position); |
304 } | 307 } |
305 tokens_iterator_.SetCurrentPosition(position); | 308 tokens_iterator_.SetCurrentPosition(position); |
306 token_kind_ = Token::kILLEGAL; | 309 token_kind_ = Token::kILLEGAL; |
307 } | 310 } |
308 | 311 |
309 | 312 |
310 void Parser::ParseCompilationUnit(const Library& library, | 313 void Parser::ParseCompilationUnit(const Library& library, |
311 const Script& script) { | 314 const Script& script, |
315 bool generating_snapshot) { | |
312 ASSERT(Isolate::Current()->long_jump_base()->IsSafeToJump()); | 316 ASSERT(Isolate::Current()->long_jump_base()->IsSafeToJump()); |
313 TimerScope timer(FLAG_compiler_stats, &CompilerStats::parser_timer); | 317 TimerScope timer(FLAG_compiler_stats, &CompilerStats::parser_timer); |
314 Parser parser(script, library); | 318 Parser parser(script, library, generating_snapshot); |
315 parser.ParseTopLevel(); | 319 parser.ParseTopLevel(); |
316 } | 320 } |
317 | 321 |
318 | 322 |
319 Token::Kind Parser::CurrentToken() { | 323 Token::Kind Parser::CurrentToken() { |
320 if (token_kind_ == Token::kILLEGAL) { | 324 if (token_kind_ == Token::kILLEGAL) { |
321 token_kind_ = tokens_iterator_.CurrentTokenKind(); | 325 token_kind_ = tokens_iterator_.CurrentTokenKind(); |
322 if (token_kind_ == Token::kERROR) { | 326 if (token_kind_ == Token::kERROR) { |
323 ErrorMsg(TokenPos(), CurrentLiteral()->ToCString()); | 327 ErrorMsg(TokenPos(), CurrentLiteral()->ToCString()); |
324 } | 328 } |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1081 signature_function, | 1085 signature_function, |
1082 script_); | 1086 script_); |
1083 // Record the function signature class in the current library. | 1087 // Record the function signature class in the current library. |
1084 library_.AddClass(signature_class); | 1088 library_.AddClass(signature_class); |
1085 } else { | 1089 } else { |
1086 signature_function.set_signature_class(signature_class); | 1090 signature_function.set_signature_class(signature_class); |
1087 } | 1091 } |
1088 ASSERT(signature_function.signature_class() == signature_class.raw()); | 1092 ASSERT(signature_function.signature_class() == signature_class.raw()); |
1089 Type& signature_type = Type::ZoneHandle(signature_class.SignatureType()); | 1093 Type& signature_type = Type::ZoneHandle(signature_class.SignatureType()); |
1090 if (!is_top_level_ && !signature_type.IsFinalized()) { | 1094 if (!is_top_level_ && !signature_type.IsFinalized()) { |
1091 signature_type ^= ClassFinalizer::FinalizeType( | 1095 signature_type ^= class_finalizer_.FinalizeType( |
1092 signature_class, signature_type, ClassFinalizer::kCanonicalize); | 1096 signature_class, signature_type, ClassFinalizer::kCanonicalize); |
1093 } | 1097 } |
1094 // The type of the parameter is now the signature type. | 1098 // The type of the parameter is now the signature type. |
1095 parameter.type = &signature_type; | 1099 parameter.type = &signature_type; |
1096 } | 1100 } |
1097 } | 1101 } |
1098 | 1102 |
1099 if (CurrentToken() == Token::kASSIGN) { | 1103 if (CurrentToken() == Token::kASSIGN) { |
1100 if (!params->has_named_optional_parameters || | 1104 if (!params->has_named_optional_parameters || |
1101 !allow_explicit_default_value) { | 1105 !allow_explicit_default_value) { |
(...skipping 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3513 ErrorMsg(interface_pos, "duplicate interface '%s'", | 3517 ErrorMsg(interface_pos, "duplicate interface '%s'", |
3514 interface_name.ToCString()); | 3518 interface_name.ToCString()); |
3515 } | 3519 } |
3516 } | 3520 } |
3517 interfaces.Add(interface); | 3521 interfaces.Add(interface); |
3518 } while (CurrentToken() == Token::kCOMMA); | 3522 } while (CurrentToken() == Token::kCOMMA); |
3519 return Array::MakeArray(interfaces); | 3523 return Array::MakeArray(interfaces); |
3520 } | 3524 } |
3521 | 3525 |
3522 | 3526 |
3527 // Add 'interface' to 'interface_list' if it is not already in the list and | |
3528 // return true. Also return true if 'interface' is not added, because it is | |
3529 // not unique, i.e. it is already in the list. | |
3530 // Return false if 'interface' conflicts with an interface already in the list | |
3531 // with the same class, but different type arguments. | |
3532 // In the case of a conflict, set 'conflicting' to the existing interface. | |
3533 static bool AddInterfaceIfUnique( | |
3534 const GrowableObjectArray& interface_list, | |
3535 const AbstractType& interface, | |
3536 AbstractType* conflicting) { | |
3537 String& interface_class_name = String::Handle(interface.ClassName()); | |
3538 String& existing_interface_class_name = String::Handle(); | |
3539 String& interface_name = String::Handle(); | |
3540 String& existing_interface_name = String::Handle(); | |
3541 AbstractType& other_interface = AbstractType::Handle(); | |
3542 for (intptr_t i = 0; i < interface_list.Length(); i++) { | |
3543 other_interface ^= interface_list.At(i); | |
3544 existing_interface_class_name = other_interface.ClassName(); | |
3545 if (interface_class_name.Equals(existing_interface_class_name)) { | |
3546 // Same interface class name, now check names of type arguments. | |
3547 interface_name = interface.Name(); | |
3548 existing_interface_name = other_interface.Name(); | |
3549 // TODO(regis): Revisit depending on the outcome of issue 4905685. | |
3550 if (!interface_name.Equals(existing_interface_name)) { | |
3551 *conflicting = other_interface.raw(); | |
3552 return false; | |
3553 } else { | |
3554 return true; | |
3555 } | |
3556 } | |
3557 } | |
3558 interface_list.Add(interface); | |
3559 return true; | |
3560 } | |
3561 | |
3562 | |
3523 void Parser::AddInterfaces(intptr_t interfaces_pos, | 3563 void Parser::AddInterfaces(intptr_t interfaces_pos, |
3524 const Class& cls, | 3564 const Class& cls, |
3525 const Array& interfaces) { | 3565 const Array& interfaces) { |
3526 const GrowableObjectArray& all_interfaces = | 3566 const GrowableObjectArray& all_interfaces = |
3527 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 3567 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
3528 AbstractType& interface = AbstractType::Handle(); | 3568 AbstractType& interface = AbstractType::Handle(); |
3529 // First get all the interfaces already implemented by class. | 3569 // First get all the interfaces already implemented by class. |
3530 Array& cls_interfaces = Array::Handle(cls.interfaces()); | 3570 Array& cls_interfaces = Array::Handle(cls.interfaces()); |
3531 for (intptr_t i = 0; i < cls_interfaces.Length(); i++) { | 3571 for (intptr_t i = 0; i < cls_interfaces.Length(); i++) { |
3532 interface ^= cls_interfaces.At(i); | 3572 interface ^= cls_interfaces.At(i); |
(...skipping 10 matching lines...) Expand all Loading... | |
3543 "interface '%s' may not extend type parameter '%s'", | 3583 "interface '%s' may not extend type parameter '%s'", |
3544 String::Handle(cls.Name()).ToCString(), | 3584 String::Handle(cls.Name()).ToCString(), |
3545 String::Handle(interface.UserVisibleName()).ToCString()); | 3585 String::Handle(interface.UserVisibleName()).ToCString()); |
3546 } else { | 3586 } else { |
3547 ErrorMsg(interfaces_pos, | 3587 ErrorMsg(interfaces_pos, |
3548 "class '%s' may not implement type parameter '%s'", | 3588 "class '%s' may not implement type parameter '%s'", |
3549 String::Handle(cls.Name()).ToCString(), | 3589 String::Handle(cls.Name()).ToCString(), |
3550 String::Handle(interface.UserVisibleName()).ToCString()); | 3590 String::Handle(interface.UserVisibleName()).ToCString()); |
3551 } | 3591 } |
3552 } | 3592 } |
3553 if (!ClassFinalizer::AddInterfaceIfUnique(all_interfaces, | 3593 if (!AddInterfaceIfUnique(all_interfaces, interface, &conflicting)) { |
3554 interface, | |
3555 &conflicting)) { | |
3556 ASSERT(!conflicting.IsNull()); | 3594 ASSERT(!conflicting.IsNull()); |
3557 ErrorMsg(interfaces_pos, | 3595 ErrorMsg(interfaces_pos, |
hausner
2012/08/22 00:15:39
I think you could emit the error message in AddInt
regis
2012/08/22 02:24:26
Done, but I needed to make AddInterfaceIfUnique an
| |
3558 "interface '%s' conflicts with interface '%s'", | 3596 "interface '%s' conflicts with interface '%s'", |
3559 String::Handle(interface.UserVisibleName()).ToCString(), | 3597 String::Handle(interface.UserVisibleName()).ToCString(), |
3560 String::Handle(conflicting.UserVisibleName()).ToCString()); | 3598 String::Handle(conflicting.UserVisibleName()).ToCString()); |
3561 } | 3599 } |
3562 } | 3600 } |
3563 cls_interfaces = Array::MakeArray(all_interfaces); | 3601 cls_interfaces = Array::MakeArray(all_interfaces); |
3564 cls.set_interfaces(cls_interfaces); | 3602 cls.set_interfaces(cls_interfaces); |
3565 } | 3603 } |
3566 | 3604 |
3567 | 3605 |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4531 CaptureInstantiator(); | 4569 CaptureInstantiator(); |
4532 } | 4570 } |
4533 | 4571 |
4534 // Since the signature type is cached by the signature class, it may have | 4572 // Since the signature type is cached by the signature class, it may have |
4535 // been finalized already. | 4573 // been finalized already. |
4536 Type& signature_type = Type::Handle(signature_class.SignatureType()); | 4574 Type& signature_type = Type::Handle(signature_class.SignatureType()); |
4537 AbstractTypeArguments& signature_type_arguments = | 4575 AbstractTypeArguments& signature_type_arguments = |
4538 AbstractTypeArguments::Handle(signature_type.arguments()); | 4576 AbstractTypeArguments::Handle(signature_type.arguments()); |
4539 | 4577 |
4540 if (!signature_type.IsFinalized()) { | 4578 if (!signature_type.IsFinalized()) { |
4541 signature_type ^= ClassFinalizer::FinalizeType( | 4579 signature_type ^= class_finalizer_.FinalizeType( |
4542 signature_class, signature_type, ClassFinalizer::kCanonicalize); | 4580 signature_class, signature_type, ClassFinalizer::kCanonicalize); |
4543 | 4581 |
4544 // The call to ClassFinalizer::FinalizeType may have | 4582 // The call to FinalizeType may have extended the vector of type arguments. |
4545 // extended the vector of type arguments. | |
4546 signature_type_arguments = signature_type.arguments(); | 4583 signature_type_arguments = signature_type.arguments(); |
4547 ASSERT(signature_type.IsMalformed() || | 4584 ASSERT(signature_type.IsMalformed() || |
4548 signature_type_arguments.IsNull() || | 4585 signature_type_arguments.IsNull() || |
4549 (signature_type_arguments.Length() == | 4586 (signature_type_arguments.Length() == |
4550 signature_class.NumTypeArguments())); | 4587 signature_class.NumTypeArguments())); |
4551 | 4588 |
4552 // The signature_class should not have changed. | 4589 // The signature_class should not have changed. |
4553 ASSERT(signature_type.IsMalformed() || | 4590 ASSERT(signature_type.IsMalformed() || |
4554 (signature_type.type_class() == signature_class.raw())); | 4591 (signature_type.type_class() == signature_class.raw())); |
4555 } | 4592 } |
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7274 unresolved_class_name); | 7311 unresolved_class_name); |
7275 } | 7312 } |
7276 // At this point, we can only have a parameterized_type. | 7313 // At this point, we can only have a parameterized_type. |
7277 Type& parameterized_type = Type::Handle(); | 7314 Type& parameterized_type = Type::Handle(); |
7278 parameterized_type ^= type->raw(); | 7315 parameterized_type ^= type->raw(); |
7279 if (!resolved_type_class.IsNull()) { | 7316 if (!resolved_type_class.IsNull()) { |
7280 // Replace unresolved class with resolved type class. | 7317 // Replace unresolved class with resolved type class. |
7281 parameterized_type.set_type_class(resolved_type_class); | 7318 parameterized_type.set_type_class(resolved_type_class); |
7282 } else if (finalization >= ClassFinalizer::kCanonicalize) { | 7319 } else if (finalization >= ClassFinalizer::kCanonicalize) { |
7283 // The type is malformed. | 7320 // The type is malformed. |
7284 ClassFinalizer::FinalizeMalformedType( | 7321 class_finalizer_.FinalizeMalformedType( |
7285 Error::Handle(), // No previous error. | 7322 Error::Handle(), // No previous error. |
7286 current_class(), parameterized_type, finalization, | 7323 current_class(), parameterized_type, finalization, |
7287 "type '%s' is not loaded", | 7324 "type '%s' is not loaded", |
7288 String::Handle(parameterized_type.UserVisibleName()).ToCString()); | 7325 String::Handle(parameterized_type.UserVisibleName()).ToCString()); |
7289 } | 7326 } |
7290 } | 7327 } |
7291 // Resolve type arguments, if any. | 7328 // Resolve type arguments, if any. |
7292 const AbstractTypeArguments& arguments = | 7329 const AbstractTypeArguments& arguments = |
7293 AbstractTypeArguments::Handle(type->arguments()); | 7330 AbstractTypeArguments::Handle(type->arguments()); |
7294 if (!arguments.IsNull()) { | 7331 if (!arguments.IsNull()) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7352 | 7389 |
7353 const Type* Parser::ReceiverType(intptr_t type_pos) const { | 7390 const Type* Parser::ReceiverType(intptr_t type_pos) const { |
7354 ASSERT(!current_class().IsNull()); | 7391 ASSERT(!current_class().IsNull()); |
7355 TypeArguments& type_arguments = TypeArguments::Handle(); | 7392 TypeArguments& type_arguments = TypeArguments::Handle(); |
7356 if (current_class().NumTypeParameters() > 0) { | 7393 if (current_class().NumTypeParameters() > 0) { |
7357 type_arguments = current_class().type_parameters(); | 7394 type_arguments = current_class().type_parameters(); |
7358 } | 7395 } |
7359 Type& type = Type::ZoneHandle( | 7396 Type& type = Type::ZoneHandle( |
7360 Type::New(current_class(), type_arguments, type_pos)); | 7397 Type::New(current_class(), type_arguments, type_pos)); |
7361 if (!is_top_level_) { | 7398 if (!is_top_level_) { |
7362 type ^= ClassFinalizer::FinalizeType( | 7399 type ^= class_finalizer_.FinalizeType( |
7363 current_class(), type, ClassFinalizer::kCanonicalizeWellFormed); | 7400 current_class(), type, ClassFinalizer::kCanonicalizeWellFormed); |
7364 } | 7401 } |
7365 return &type; | 7402 return &type; |
7366 } | 7403 } |
7367 | 7404 |
7368 | 7405 |
7369 bool Parser::IsInstantiatorRequired() const { | 7406 bool Parser::IsInstantiatorRequired() const { |
7370 ASSERT(!current_function().IsNull()); | 7407 ASSERT(!current_function().IsNull()); |
7371 Function& outer_function = Function::Handle(current_function().raw()); | 7408 Function& outer_function = Function::Handle(current_function().raw()); |
7372 while (outer_function.IsLocalFunction()) { | 7409 while (outer_function.IsLocalFunction()) { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7959 Type& parameterized_type = Type::Handle(); | 7996 Type& parameterized_type = Type::Handle(); |
7960 parameterized_type ^= type.raw(); | 7997 parameterized_type ^= type.raw(); |
7961 parameterized_type.set_type_class(Class::Handle(Object::dynamic_class())); | 7998 parameterized_type.set_type_class(Class::Handle(Object::dynamic_class())); |
7962 parameterized_type.set_arguments(AbstractTypeArguments::Handle()); | 7999 parameterized_type.set_arguments(AbstractTypeArguments::Handle()); |
7963 parameterized_type.set_malformed_error(malformed_error); | 8000 parameterized_type.set_malformed_error(malformed_error); |
7964 } | 8001 } |
7965 if (finalization >= ClassFinalizer::kTryResolve) { | 8002 if (finalization >= ClassFinalizer::kTryResolve) { |
7966 const Class& scope_class = Class::Handle(TypeParametersScopeClass()); | 8003 const Class& scope_class = Class::Handle(TypeParametersScopeClass()); |
7967 ResolveTypeFromClass(scope_class, finalization, &type); | 8004 ResolveTypeFromClass(scope_class, finalization, &type); |
7968 if (finalization >= ClassFinalizer::kCanonicalize) { | 8005 if (finalization >= ClassFinalizer::kCanonicalize) { |
7969 type ^= ClassFinalizer::FinalizeType(current_class(), type, finalization); | 8006 type ^= class_finalizer_.FinalizeType( |
8007 current_class(), type, finalization); | |
7970 } | 8008 } |
7971 } | 8009 } |
7972 return type.raw(); | 8010 return type.raw(); |
7973 } | 8011 } |
7974 | 8012 |
7975 | 8013 |
7976 void Parser::CheckConstructorCallTypeArguments( | 8014 void Parser::CheckConstructorCallTypeArguments( |
7977 intptr_t pos, Function& constructor, | 8015 intptr_t pos, Function& constructor, |
7978 const AbstractTypeArguments& type_arguments) { | 8016 const AbstractTypeArguments& type_arguments) { |
7979 if (!type_arguments.IsNull()) { | 8017 if (!type_arguments.IsNull()) { |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8546 type_argument = type_arguments.TypeAt(i); | 8584 type_argument = type_arguments.TypeAt(i); |
8547 } else { | 8585 } else { |
8548 type_argument = Type::DynamicType(); | 8586 type_argument = Type::DynamicType(); |
8549 } | 8587 } |
8550 temp_type_arguments.SetTypeAt(i, type_argument); | 8588 temp_type_arguments.SetTypeAt(i, type_argument); |
8551 } | 8589 } |
8552 } | 8590 } |
8553 Type& temp_type = Type::Handle(Type::New( | 8591 Type& temp_type = Type::Handle(Type::New( |
8554 constructor_class, temp_type_arguments, type.token_pos(), Heap::kNew)); | 8592 constructor_class, temp_type_arguments, type.token_pos(), Heap::kNew)); |
8555 // No need to canonicalize temporary type. | 8593 // No need to canonicalize temporary type. |
8556 temp_type ^= ClassFinalizer::FinalizeType( | 8594 temp_type ^= class_finalizer_.FinalizeType( |
8557 current_class(), temp_type, ClassFinalizer::kFinalize); | 8595 current_class(), temp_type, ClassFinalizer::kFinalize); |
8558 // The type argument vector may have been expanded with the type arguments | 8596 // The type argument vector may have been expanded with the type arguments |
8559 // of the super type when finalizing the temporary type. | 8597 // of the super type when finalizing the temporary type. |
8560 type_arguments = temp_type.arguments(); | 8598 type_arguments = temp_type.arguments(); |
8561 // The type parameter bounds of the factory class may be more specific than | 8599 // The type parameter bounds of the factory class may be more specific than |
8562 // the type parameter bounds of the interface class. Therefore, although | 8600 // the type parameter bounds of the interface class. Therefore, although |
8563 // type was not malformed, temp_type may be malformed. | 8601 // type was not malformed, temp_type may be malformed. |
8564 if (!type.IsMalformed() && temp_type.IsMalformed()) { | 8602 if (!type.IsMalformed() && temp_type.IsMalformed()) { |
8565 const Error& error = Error::Handle(temp_type.malformed_error()); | 8603 const Error& error = Error::Handle(temp_type.malformed_error()); |
8566 type.set_malformed_error(error); | 8604 type.set_malformed_error(error); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9188 void Parser::SkipQualIdent() { | 9226 void Parser::SkipQualIdent() { |
9189 ASSERT(IsIdentifier()); | 9227 ASSERT(IsIdentifier()); |
9190 ConsumeToken(); | 9228 ConsumeToken(); |
9191 if (CurrentToken() == Token::kPERIOD) { | 9229 if (CurrentToken() == Token::kPERIOD) { |
9192 ConsumeToken(); // Consume the kPERIOD token. | 9230 ConsumeToken(); // Consume the kPERIOD token. |
9193 ExpectIdentifier("identifier expected after '.'"); | 9231 ExpectIdentifier("identifier expected after '.'"); |
9194 } | 9232 } |
9195 } | 9233 } |
9196 | 9234 |
9197 } // namespace dart | 9235 } // namespace dart |
OLD | NEW |