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

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: 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') | tools/gn/parser_unittest.cc » ('J')
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..df027ca91808e9fc2b0d800eb3a8904aa80da407 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -388,9 +388,9 @@ 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())
scottmg 2015/04/07 19:49:52 nit; braces for multiline if.
mdempsky 2015/04/07 19:58:44 Done.
+ *err_ = Err(token, "Expected right hand side for '" +
+ token.value().as_string() + "'");
scottmg 2015/04/07 19:49:52 is there a test that hits this code path now? if y
mdempsky 2015/04/07 19:58:44 Yes, DoExpressionErrorTest("(a +", 1, 4) in Parser
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') | tools/gn/parser_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698