aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/utility.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-16 08:06:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:47:17 +0200
commit9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 (patch)
tree81e07870c7a16f12c7aca69bf70a71d69251d1fc /libbuild2/config/utility.cxx
parent1adbf7b710d52958f6c0168ccb492252c1f19d4a (diff)
Rework config::{omitted,required,optional}() into unified config_lookup()
Diffstat (limited to 'libbuild2/config/utility.cxx')
-rw-r--r--libbuild2/config/utility.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/libbuild2/config/utility.cxx b/libbuild2/config/utility.cxx
index b9fc513..8ad150e 100644
--- a/libbuild2/config/utility.cxx
+++ b/libbuild2/config/utility.cxx
@@ -17,9 +17,9 @@ namespace build2
namespace config
{
pair<lookup, bool>
- omitted (scope& rs, const variable& var)
+ lookup_config_impl (scope& rs, const variable& var)
{
- // This is a stripped-down version of the required()'s twisted logic.
+ // This is a stripped-down version of the default value case.
pair<lookup, size_t> org (rs.find_original (var));
@@ -50,19 +50,8 @@ namespace build2
return pair<lookup, bool> (l, n);
}
- lookup
- optional (scope& rs, const variable& var)
- {
- save_variable (rs, var);
-
- auto l (rs[var]);
- return l.defined ()
- ? l
- : lookup (rs.assign (var), var, rs); // NULL.
- }
-
bool
- specified (scope& rs, const string& n)
+ specified_config (scope& rs, const string& n)
{
// Search all outer scopes for any value in this namespace.
//