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 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2955 ErrorMsg(alias_name_pos, | 2955 ErrorMsg(alias_name_pos, |
2956 "'%s' is already defined", alias_name->ToCString()); | 2956 "'%s' is already defined", alias_name->ToCString()); |
2957 } | 2957 } |
2958 | 2958 |
2959 // Create the function type alias, but share the signature function of the | 2959 // Create the function type alias, but share the signature function of the |
2960 // canonical signature class. | 2960 // canonical signature class. |
2961 Class& function_type_alias = Class::Handle( | 2961 Class& function_type_alias = Class::Handle( |
2962 Class::NewSignatureClass(*alias_name, | 2962 Class::NewSignatureClass(*alias_name, |
2963 signature_function, | 2963 signature_function, |
2964 script_)); | 2964 script_)); |
| 2965 // This alias should not be marked as finalized yet, since it needs to be |
| 2966 // checked in the class finalizer for illegal self references. |
| 2967 ASSERT(!function_type_alias.IsCanonicalSignatureClass()); |
| 2968 ASSERT(!function_type_alias.is_finalized()); |
2965 library_.AddClass(function_type_alias); | 2969 library_.AddClass(function_type_alias); |
2966 ExpectSemicolon(); | 2970 ExpectSemicolon(); |
2967 pending_classes.Add(function_type_alias, Heap::kOld); | 2971 pending_classes.Add(function_type_alias, Heap::kOld); |
2968 } | 2972 } |
2969 | 2973 |
2970 | 2974 |
2971 void Parser::ParseInterfaceDefinition( | 2975 void Parser::ParseInterfaceDefinition( |
2972 const GrowableObjectArray& pending_classes) { | 2976 const GrowableObjectArray& pending_classes) { |
2973 TRACE_PARSER("ParseInterfaceDefinition"); | 2977 TRACE_PARSER("ParseInterfaceDefinition"); |
2974 const intptr_t interface_pos = token_index_; | 2978 const intptr_t interface_pos = token_index_; |
(...skipping 5466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8441 void Parser::SkipQualIdent() { | 8445 void Parser::SkipQualIdent() { |
8442 ASSERT(IsIdentifier()); | 8446 ASSERT(IsIdentifier()); |
8443 ConsumeToken(); | 8447 ConsumeToken(); |
8444 if (CurrentToken() == Token::kPERIOD) { | 8448 if (CurrentToken() == Token::kPERIOD) { |
8445 ConsumeToken(); // Consume the kPERIOD token. | 8449 ConsumeToken(); // Consume the kPERIOD token. |
8446 ExpectIdentifier("identifier expected after '.'"); | 8450 ExpectIdentifier("identifier expected after '.'"); |
8447 } | 8451 } |
8448 } | 8452 } |
8449 | 8453 |
8450 } // namespace dart | 8454 } // namespace dart |
OLD | NEW |