Index: tools/gn/parser.cc |
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc |
index 38f7abbf2dece58d5957e4378e98e7cf08ff4cfe..68be911843f6b55e24bc0d0285244a9a4664bb50 100644 |
--- a/tools/gn/parser.cc |
+++ b/tools/gn/parser.cc |
@@ -289,15 +289,18 @@ scoped_ptr<ParseNode> Parser::IdentifierOrCall(scoped_ptr<ParseNode> left, |
bool has_arg = false; |
if (LookAhead(Token::LEFT_PAREN)) { |
Token start_token = Consume(); |
+ list->set_begin_token(start_token); |
// Parsing a function call. |
has_arg = true; |
- if (Match(Token::RIGHT_PAREN)) { |
+ if (LookAhead(Token::RIGHT_PAREN)) { |
// Nothing, just an empty call. |
+ list->set_end(make_scoped_ptr(new EndNode(Consume()))); |
} else { |
list = ParseList(start_token, Token::RIGHT_PAREN, false); |
if (has_error()) |
return scoped_ptr<ParseNode>(); |
- Consume(Token::RIGHT_PAREN, "Expected ')' after call"); |
+ list->set_end(make_scoped_ptr( |
+ new EndNode(Consume(Token::RIGHT_PAREN, "Expected ')' after call")))); |
} |
// Optionally with a scope. |
if (LookAhead(Token::LEFT_BRACE)) { |