| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3429 outer_scope = new LocalScope(current_block_->scope, | 3429 outer_scope = new LocalScope(current_block_->scope, |
| 3430 current_block_->scope->function_level() + 1, | 3430 current_block_->scope->function_level() + 1, |
| 3431 0); | 3431 0); |
| 3432 } | 3432 } |
| 3433 ChainNewBlock(outer_scope); | 3433 ChainNewBlock(outer_scope); |
| 3434 } | 3434 } |
| 3435 | 3435 |
| 3436 | 3436 |
| 3437 SequenceNode* Parser::CloseBlock() { | 3437 SequenceNode* Parser::CloseBlock() { |
| 3438 SequenceNode* statements = current_block_->statements; | 3438 SequenceNode* statements = current_block_->statements; |
| 3439 if (current_block_->scope != NULL) { |
| 3440 // Record the end token index of the scope. |
| 3441 current_block_->scope->set_end_token_index(token_index_); |
| 3442 } |
| 3439 current_block_ = current_block_->parent; | 3443 current_block_ = current_block_->parent; |
| 3440 return statements; | 3444 return statements; |
| 3441 } | 3445 } |
| 3442 | 3446 |
| 3443 | 3447 |
| 3444 // Set up default values for all optional parameters to the function. | 3448 // Set up default values for all optional parameters to the function. |
| 3445 void Parser::SetupDefaultsForOptionalParams(const ParamList* params, | 3449 void Parser::SetupDefaultsForOptionalParams(const ParamList* params, |
| 3446 Array& default_values) { | 3450 Array& default_values) { |
| 3447 if (params->num_optional_parameters > 0) { | 3451 if (params->num_optional_parameters > 0) { |
| 3448 // Build array of default parameter values. | 3452 // Build array of default parameter values. |
| (...skipping 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7685 } | 7689 } |
| 7686 | 7690 |
| 7687 | 7691 |
| 7688 void Parser::SkipNestedExpr() { | 7692 void Parser::SkipNestedExpr() { |
| 7689 const bool saved_mode = SetAllowFunctionLiterals(true); | 7693 const bool saved_mode = SetAllowFunctionLiterals(true); |
| 7690 SkipExpr(); | 7694 SkipExpr(); |
| 7691 SetAllowFunctionLiterals(saved_mode); | 7695 SetAllowFunctionLiterals(saved_mode); |
| 7692 } | 7696 } |
| 7693 | 7697 |
| 7694 } // namespace dart | 7698 } // namespace dart |
| OLD | NEW |