Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2058)

Unified Diff: tools/gn/parser.cc

Issue 742003002: gn format: penalty-based line breaking WIP XXX Base URL: https://chromium.googlesource.com/chromium/src.git@gn-more-disabled
Patch Set: futzing Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/parse_tree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « tools/gn/parse_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698