aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-04 07:27:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:35:29 +0200
commita54abb2f4e5e66877619097bfd281261f99c5103 (patch)
treeb10a24fd2c5d1d1dd2602f25cc7228b287200cbb /libbuild2/parser.cxx
parente63b427c51e37135e50dec9435659d661872fe95 (diff)
Add recognition for line-leading `%` as token
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index e87ca95..000670b 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -335,6 +335,11 @@ namespace build2
while (tt != type::eos && !(one && parsed))
{
+ // Issue better diagnostics for stray `%`.
+ //
+ if (tt == type::percent)
+ fail (t) << "recipe without target";
+
// Extract attributes if any.
//
assert (attributes_.empty ());