Chromium Code Reviews| Index: runtime/vm/parser.cc |
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
| index 247fbc7f70c8acc5bb4ed2b4059c983d954c397c..3aef333809cd50808c0413c0289c75a881294a2a 100644 |
| --- a/runtime/vm/parser.cc |
| +++ b/runtime/vm/parser.cc |
| @@ -2698,14 +2698,17 @@ SequenceNode* Parser::ParseFunc(const Function& func, |
| ConsumeToken(); |
| ParseStatementSequence(); |
| ExpectToken(Token::kRBRACE); |
| + func.set_end_token_pos(TokenPos() - 1); |
|
hausner
2013/08/20 17:49:44
Read the closing brace after setting the end token
Michael Lippautz (Google)
2013/08/21 16:50:03
Done.
|
| } else if (CurrentToken() == Token::kARROW) { |
| ConsumeToken(); |
| const intptr_t expr_pos = TokenPos(); |
| AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades); |
| ASSERT(expr != NULL); |
| current_block_->statements->Add(new ReturnNode(expr_pos, expr)); |
| + func.set_end_token_pos(TokenPos()); |
| } else if (IsLiteral("native")) { |
| ParseNativeFunctionBlock(¶ms, func); |
|
hausner
2013/08/20 17:49:44
Can you refactor the code so that ParseNativeFunct
Michael Lippautz (Google)
2013/08/21 16:50:03
Done.
|
| + func.set_end_token_pos(TokenPos() - 1); |
| } else if (func.is_external()) { |
| // Body of an external method contains a single throw. |
| const String& function_name = String::ZoneHandle(func.name()); |
| @@ -5308,8 +5311,6 @@ AstNode* Parser::ParseFunctionStatement(bool is_literal) { |
| Array& default_parameter_values = Array::Handle(); |
| SequenceNode* statements = Parser::ParseFunc(function, |
| default_parameter_values); |
| - ASSERT(is_new_closure || (function.end_token_pos() == (TokenPos() - 1))); |
| - function.set_end_token_pos(TokenPos() - 1); |
| // Now that the local function has formal parameters, lookup the signature |
| // class in the current library (but not in its imports) and only create a new |