diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-06-20 20:33:52 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-06-21 13:09:10 +0300 |
commit | 5c186f901ea7d1b09ab551a3fd2a6c1fd2426d59 (patch) | |
tree | aa41f235d3ef632c481390745bc0d589bd9c554e /libbbot/build-config.cxx | |
parent | 4ef51955f2c0c2da17bb922d52fd39eae0bf4464 (diff) |
Add support for build configuration warning-detecting regexes
Diffstat (limited to 'libbbot/build-config.cxx')
-rw-r--r-- | libbbot/build-config.cxx | 24 |
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) |