From fc84d5b527a17a5360d375ade4cdc17e4f8a6b88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Dec 2023 08:22:15 +0200 Subject: Improve parser diagnostics --- libbuild2/parser.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- cgit v1.1