aboutsummaryrefslogtreecommitdiff
path: root/bbot/build-config.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-20 22:01:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-20 22:01:57 +0300
commit773fbb10eb59c4e855eccf9966a6ef3a68e3e0c3 (patch)
tree55178311afbf48536088fa4a83b3bf45d8ebcf0c /bbot/build-config.cxx
parent4b9c521172a2c30a84f76fcedcec37247878a24f (diff)
Get rid of variable struct
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.