| 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 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 11814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11825 Error::Handle(Z), // No previous error. | 11825 Error::Handle(Z), // No previous error. |
| 11826 script_, | 11826 script_, |
| 11827 type->token_pos(), | 11827 type->token_pos(), |
| 11828 "type parameter '%s' cannot be referenced " | 11828 "type parameter '%s' cannot be referenced " |
| 11829 "from static member", | 11829 "from static member", |
| 11830 String::Handle(Z, type_parameter.name()).ToCString()); | 11830 String::Handle(Z, type_parameter.name()).ToCString()); |
| 11831 return; | 11831 return; |
| 11832 } | 11832 } |
| 11833 // A type parameter cannot be parameterized, so make the type | 11833 // A type parameter cannot be parameterized, so make the type |
| 11834 // malformed if type arguments have previously been parsed. | 11834 // malformed if type arguments have previously been parsed. |
| 11835 if (!TypeArguments::Handle(Z, type->arguments()).IsNull()) { | 11835 if (type->arguments() != TypeArguments::null()) { |
| 11836 *type = ClassFinalizer::NewFinalizedMalformedType( | 11836 *type = ClassFinalizer::NewFinalizedMalformedType( |
| 11837 Error::Handle(Z), // No previous error. | 11837 Error::Handle(Z), // No previous error. |
| 11838 script_, | 11838 script_, |
| 11839 type_parameter.token_pos(), | 11839 type_parameter.token_pos(), |
| 11840 "type parameter '%s' cannot be parameterized", | 11840 "type parameter '%s' cannot be parameterized", |
| 11841 String::Handle(Z, type_parameter.name()).ToCString()); | 11841 String::Handle(Z, type_parameter.name()).ToCString()); |
| 11842 return; | 11842 return; |
| 11843 } | 11843 } |
| 11844 *type = type_parameter.raw(); | 11844 *type = type_parameter.raw(); |
| 11845 return; | 11845 return; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 11866 ClassFinalizer::FinalizeMalformedType( | 11866 ClassFinalizer::FinalizeMalformedType( |
| 11867 Error::Handle(Z), // No previous error. | 11867 Error::Handle(Z), // No previous error. |
| 11868 script_, | 11868 script_, |
| 11869 parameterized_type, | 11869 parameterized_type, |
| 11870 "type '%s' is not loaded", | 11870 "type '%s' is not loaded", |
| 11871 String::Handle(Z, parameterized_type.UserVisibleName()).ToCString()); | 11871 String::Handle(Z, parameterized_type.UserVisibleName()).ToCString()); |
| 11872 return; | 11872 return; |
| 11873 } | 11873 } |
| 11874 } | 11874 } |
| 11875 // Resolve type arguments, if any. | 11875 // Resolve type arguments, if any. |
| 11876 const TypeArguments& arguments = TypeArguments::Handle(Z, type->arguments()); | 11876 if (type->arguments() != TypeArguments::null()) { |
| 11877 if (!arguments.IsNull()) { | 11877 const TypeArguments& arguments = |
| 11878 TypeArguments::Handle(Z, type->arguments()); |
| 11878 const intptr_t num_arguments = arguments.Length(); | 11879 const intptr_t num_arguments = arguments.Length(); |
| 11880 AbstractType& type_argument = AbstractType::Handle(Z); |
| 11879 for (intptr_t i = 0; i < num_arguments; i++) { | 11881 for (intptr_t i = 0; i < num_arguments; i++) { |
| 11880 AbstractType& type_argument = AbstractType::Handle(Z, | 11882 type_argument ^= arguments.TypeAt(i); |
| 11881 arguments.TypeAt(i)); | |
| 11882 ResolveTypeFromClass(scope_class, finalization, &type_argument); | 11883 ResolveTypeFromClass(scope_class, finalization, &type_argument); |
| 11883 arguments.SetTypeAt(i, type_argument); | 11884 arguments.SetTypeAt(i, type_argument); |
| 11884 } | 11885 } |
| 11885 } | 11886 } |
| 11886 } | 11887 } |
| 11887 | 11888 |
| 11888 | 11889 |
| 11889 LocalVariable* Parser::LookupLocalScope(const String& ident) { | 11890 LocalVariable* Parser::LookupLocalScope(const String& ident) { |
| 11890 if (current_block_ == NULL) { | 11891 if (current_block_ == NULL) { |
| 11891 return NULL; | 11892 return NULL; |
| (...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14473 const ArgumentListNode& function_args, | 14474 const ArgumentListNode& function_args, |
| 14474 const LocalVariable* temp_for_last_arg, | 14475 const LocalVariable* temp_for_last_arg, |
| 14475 bool is_super_invocation) { | 14476 bool is_super_invocation) { |
| 14476 UNREACHABLE(); | 14477 UNREACHABLE(); |
| 14477 return NULL; | 14478 return NULL; |
| 14478 } | 14479 } |
| 14479 | 14480 |
| 14480 } // namespace dart | 14481 } // namespace dart |
| 14481 | 14482 |
| 14482 #endif // DART_PRECOMPILED_RUNTIME | 14483 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |