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

Unified Diff: tools/gn/parser.cc

Issue 1068623002: tools/gn: provide better error message for bogus binary expressions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scottmg feedback Created 5 years, 8 months 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 | « no previous file | tools/gn/parser_unittest.cc » ('j') | 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 651c0f88d5e8f0e965117764fe6f4547acbc5852..c207ce7179ec72474ad20603d0e8ab929b7f0793 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -388,9 +388,10 @@ scoped_ptr<ParseNode> Parser::BinaryOperator(scoped_ptr<ParseNode> left,
scoped_ptr<ParseNode> right =
ParseExpression(expressions_[token.type()].precedence + 1);
if (!right) {
- *err_ =
- Err(token,
- "Expected right hand side for '" + token.value().as_string() + "'");
+ if (!has_error()) {
+ *err_ = Err(token, "Expected right hand side for '" +
+ token.value().as_string() + "'");
+ }
return scoped_ptr<ParseNode>();
}
scoped_ptr<BinaryOpNode> binary_op(new BinaryOpNode);
« no previous file with comments | « no previous file | tools/gn/parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698