aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-09-30 16:29:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-09-30 16:29:17 +0200
commit6cd17e76c18981ebc24e0fb630373e6386d610b7 (patch)
tree6e4f68e5ac3eb70fc0e7511f97c8acc2e6c9811b /libbuild2
parent240ad9ab0c871f7db2687d9ab3433df9a26775fa (diff)
Fix bug in for-loop body evaluation
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/parser.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 735677e..0a5142f 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -843,7 +843,7 @@ namespace build2
}
if (tt != type::rcbrace)
- fail (t) << "expected '}' instead of " << t;
+ fail (t) << "expected name or '}' instead of " << t;
next (t, tt); // Presumably newline after '}'.
next_after_newline (t, tt, '}'); // Should be on its own line.
@@ -2026,8 +2026,8 @@ namespace build2
skip_block (t, tt);
if (tt != type::rcbrace)
- fail (t) << "expected '}' instead of " << t << " at the end of " << k
- << "-block";
+ fail (t) << "expected name or '}' instead of " << t
+ << " at the end of " << k << "-block";
next (t, tt); // Presumably newline after '}'.
next_after_newline (t, tt, '}'); // Should be on its own line.
@@ -2349,8 +2349,8 @@ namespace build2
skip_block (t, tt);
if (tt != type::rcbrace)
- fail (t) << "expected '}' instead of " << t << " at the end of " << k
- << "-block";
+ fail (t) << "expected name or '}' instead of " << t
+ << " at the end of " << k << "-block";
next (t, tt); // Presumably newline after '}'.
next_after_newline (t, tt, '}'); // Should be on its own line.
@@ -2517,8 +2517,12 @@ namespace build2
next (t, tt); // {
next (t, tt); // <newline>
}
+
parse_clause (t, tt);
- assert (tt == (block ? type::rcbrace : type::eos));
+
+ if (tt != (block ? type::rcbrace : type::eos))
+ fail (t) << "expected name " << (block ? "or '}' " : "")
+ << "instead of " << t;
lexer_ = ol;