aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-12-04 08:22:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-12-04 08:22:15 +0200
commitfc84d5b527a17a5360d375ade4cdc17e4f8a6b88 (patch)
tree0e81e50c953ae2e9ab51e281d98a502f9bcfdd74
parent4b21203e46f9f134b4a5df4bfbfebf9b875d3677 (diff)
Improve parser diagnostics
-rw-r--r--libbuild2/parser.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 2417ea5..3caf097 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -4427,7 +4427,7 @@ namespace build2
// is not an option. So let's skip it.
//
if (taken)
- skip_line (t, tt);
+ skip_line (t, tt); // Skip expression.
else
{
if (tt == type::newline || tt == type::eos)
@@ -4489,6 +4489,10 @@ namespace build2
}
else if (!multi) // No lines in multi-curly if-else.
{
+ if (tt == type::multi_lcbrace)
+ fail (t) << "expected " << k << "-line instead of " << t <<
+ info << "did you forget to specify % recipe header?";
+
if (take)
{
if (!parse_clause (t, tt, true))