aboutsummaryrefslogtreecommitdiff
path: root/bbot/build-config.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bbot/build-config.cxx')
-rw-r--r--bbot/build-config.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/bbot/build-config.cxx b/bbot/build-config.cxx
index 226ead3..0ee00e9 100644
--- a/bbot/build-config.cxx
+++ b/bbot/build-config.cxx
@@ -13,6 +13,8 @@
#include <butl/fdstream>
#include <butl/tab-parser>
+#include <bbot/manifest> // task_manifest::check_config()
+
using namespace std;
using namespace butl;
@@ -34,17 +36,17 @@ namespace bbot
// then we refer to the end-of-line column (presumably reporting a missed
// field).
//
- auto bad_line = [&name, &tl, &i, n] (const string& d, size_t offset = 0)
+ auto bad_line = [&name, &tl, &i, n] (const string& d)
{
// Offset beyond the end-of-line is meaningless.
//
- assert (i < n || (i == n && offset == 0));
+ assert (i <= n);
throw tab_parsing (name,
tl.line,
i == n
? tl.end_column
- : tl[i].column + offset,
+ : tl[i].column,
d);
};
@@ -93,12 +95,14 @@ namespace bbot
try
{
for (; i < n; ++i)
- config.vars.emplace_back (variable (move (tl[i].value)));
+ {
+ task_manifest::check_config (tl[i].value);
+ config.vars.emplace_back (move (tl[i].value));
+ }
}
- catch (const invalid_variable& e)
+ catch (const invalid_argument& e)
{
- bad_line (e.what (), e.pos); // Note that tl[i].value is moved from,
- // but happily we don't use it
+ bad_line (e.what ());
}
// Save the configuration.