aboutsummaryrefslogtreecommitdiff
path: root/libbbot/build-config.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbbot/build-config.cxx')
-rw-r--r--libbbot/build-config.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/libbbot/build-config.cxx b/libbbot/build-config.cxx
index 071ad7f..f18c48a 100644
--- a/libbbot/build-config.cxx
+++ b/libbbot/build-config.cxx
@@ -75,14 +75,15 @@ namespace bbot
continue;
}
- // If the third field doesn't contain '=' character, then we will treat
- // it as a target.
+ // If the third field doesn't start with '~' character and doesn't
+ // contain '=' character, then we will treat it as a target.
//
- if (tl[i].value.find ('=') == string::npos)
+ const string& v (tl[i].value);
+ if (v[0] != '~' && v.find ('=') == string::npos)
{
try
{
- config.target = target_triplet (tl[i].value);
+ config.target = target_triplet (v);
}
catch (const invalid_argument& e)
{
@@ -96,8 +97,19 @@ namespace bbot
{
for (; i < n; ++i)
{
- task_manifest::check_config (tl[i].value);
- config.vars.emplace_back (move (tl[i].value));
+ string& v (tl[i].value);
+
+ if (v[0] == '~') // Regular expression.
+ {
+ string re (v, 1);
+ task_manifest::check_regex (re);
+ config.warning_regexes.emplace_back (move (re));
+ }
+ else // Configuration variable.
+ {
+ task_manifest::check_config (v);
+ config.vars.emplace_back (move (v));
+ }
}
}
catch (const invalid_argument& e)