| 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 7886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7897 } | 7897 } |
| 7898 } | 7898 } |
| 7899 // TODO(regis): Temporary type should be allocated in new gen heap. | 7899 // TODO(regis): Temporary type should be allocated in new gen heap. |
| 7900 Type& temp_type = Type::Handle( | 7900 Type& temp_type = Type::Handle( |
| 7901 Type::New(constructor_class, temp_type_arguments, type.token_index())); | 7901 Type::New(constructor_class, temp_type_arguments, type.token_index())); |
| 7902 temp_type ^= ClassFinalizer::FinalizeType( | 7902 temp_type ^= ClassFinalizer::FinalizeType( |
| 7903 current_class(), temp_type, ClassFinalizer::kFinalize); | 7903 current_class(), temp_type, ClassFinalizer::kFinalize); |
| 7904 // The type argument vector may have been expanded with the type arguments | 7904 // The type argument vector may have been expanded with the type arguments |
| 7905 // of the super type when finalizing the temporary type. | 7905 // of the super type when finalizing the temporary type. |
| 7906 type_arguments = temp_type.arguments(); | 7906 type_arguments = temp_type.arguments(); |
| 7907 // The type parameter bounds of the factory class may be more specific than |
| 7908 // the type parameter bounds of the interface class. Therefore, although |
| 7909 // type was not malformed, temp_type may be malformed. |
| 7910 if (!type.IsMalformed() && temp_type.IsMalformed()) { |
| 7911 const Error& error = Error::Handle(temp_type.malformed_error()); |
| 7912 type.set_malformed_error(error); |
| 7913 } |
| 7907 } | 7914 } |
| 7908 | 7915 |
| 7909 type_arguments ^= type_arguments.Canonicalize(); | 7916 type_arguments ^= type_arguments.Canonicalize(); |
| 7910 // Make the constructor call. | 7917 // Make the constructor call. |
| 7911 AstNode* new_object = NULL; | 7918 AstNode* new_object = NULL; |
| 7912 if (is_const) { | 7919 if (is_const) { |
| 7913 if (!constructor.is_const()) { | 7920 if (!constructor.is_const()) { |
| 7914 ErrorMsg("'const' requires const constructor: '%s'", | 7921 ErrorMsg("'const' requires const constructor: '%s'", |
| 7915 String::Handle(constructor.name()).ToCString()); | 7922 String::Handle(constructor.name()).ToCString()); |
| 7916 } | 7923 } |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8516 void Parser::SkipQualIdent() { | 8523 void Parser::SkipQualIdent() { |
| 8517 ASSERT(IsIdentifier()); | 8524 ASSERT(IsIdentifier()); |
| 8518 ConsumeToken(); | 8525 ConsumeToken(); |
| 8519 if (CurrentToken() == Token::kPERIOD) { | 8526 if (CurrentToken() == Token::kPERIOD) { |
| 8520 ConsumeToken(); // Consume the kPERIOD token. | 8527 ConsumeToken(); // Consume the kPERIOD token. |
| 8521 ExpectIdentifier("identifier expected after '.'"); | 8528 ExpectIdentifier("identifier expected after '.'"); |
| 8522 } | 8529 } |
| 8523 } | 8530 } |
| 8524 | 8531 |
| 8525 } // namespace dart | 8532 } // namespace dart |
| OLD | NEW |