| 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 4064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4075 if (variable_name != NULL) { | 4075 if (variable_name != NULL) { |
| 4076 // Since the function type depends on the signature of the closure function, | 4076 // Since the function type depends on the signature of the closure function, |
| 4077 // it cannot be determined before the formal parameter list of the closure | 4077 // it cannot be determined before the formal parameter list of the closure |
| 4078 // function is parsed. Therefore, we set the function type to a new | 4078 // function is parsed. Therefore, we set the function type to a new |
| 4079 // parameterized type to be patched after the actual type is known. | 4079 // parameterized type to be patched after the actual type is known. |
| 4080 // We temporarily use the class of the Function interface. | 4080 // We temporarily use the class of the Function interface. |
| 4081 const Class& unknown_signature_class = Class::Handle( | 4081 const Class& unknown_signature_class = Class::Handle( |
| 4082 Type::Handle(Type::FunctionInterface()).type_class()); | 4082 Type::Handle(Type::FunctionInterface()).type_class()); |
| 4083 function_type = Type::New( | 4083 function_type = Type::New( |
| 4084 unknown_signature_class, TypeArguments::Handle(), ident_pos); | 4084 unknown_signature_class, TypeArguments::Handle(), ident_pos); |
| 4085 function_type.set_is_finalized(); // No real finalization needed. | 4085 function_type.set_is_finalized_instantiated(); // No finalization needed. |
| 4086 | 4086 |
| 4087 // Add the function variable to the scope before parsing the function in | 4087 // Add the function variable to the scope before parsing the function in |
| 4088 // order to allow self reference from inside the function. | 4088 // order to allow self reference from inside the function. |
| 4089 function_variable = new LocalVariable(ident_pos, | 4089 function_variable = new LocalVariable(ident_pos, |
| 4090 *variable_name, | 4090 *variable_name, |
| 4091 function_type); | 4091 function_type); |
| 4092 function_variable->set_is_final(); | 4092 function_variable->set_is_final(); |
| 4093 ASSERT(current_block_ != NULL); | 4093 ASSERT(current_block_ != NULL); |
| 4094 ASSERT(current_block_->scope != NULL); | 4094 ASSERT(current_block_->scope != NULL); |
| 4095 if (!current_block_->scope->AddVariable(function_variable)) { | 4095 if (!current_block_->scope->AddVariable(function_variable)) { |
| (...skipping 4315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8411 void Parser::SkipQualIdent() { | 8411 void Parser::SkipQualIdent() { |
| 8412 ASSERT(IsIdentifier()); | 8412 ASSERT(IsIdentifier()); |
| 8413 ConsumeToken(); | 8413 ConsumeToken(); |
| 8414 if (CurrentToken() == Token::kPERIOD) { | 8414 if (CurrentToken() == Token::kPERIOD) { |
| 8415 ConsumeToken(); // Consume the kPERIOD token. | 8415 ConsumeToken(); // Consume the kPERIOD token. |
| 8416 ExpectIdentifier("identifier expected after '.'"); | 8416 ExpectIdentifier("identifier expected after '.'"); |
| 8417 } | 8417 } |
| 8418 } | 8418 } |
| 8419 | 8419 |
| 8420 } // namespace dart | 8420 } // namespace dart |
| OLD | NEW |