diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-16 08:57:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-17 07:47:17 +0200 |
commit | 962f83b1e551cc683f1052d32cb79b969e65af5f (patch) | |
tree | 8e3d1936db8be9b07baffac289bb3b4e06010cf8 /libbuild2/variable.hxx | |
parent | 9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 (diff) |
Rename all find*(variable) to lookup*(variable)
Now we consistently use term "lookup" for variable value lookup. At some
point we should also rename type lookup to binding and get rid of all the
lookup_type aliases.
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r-- | libbuild2/variable.hxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 02df60b..071cb5f 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -1362,44 +1362,46 @@ namespace build2 // Lookup. Note that variable overrides will not be applied, even if // set in this map. // - lookup + using lookup_type = build2::lookup; + + lookup_type operator[] (const variable& var) const { - auto p (find (var)); - return lookup (p.first, &p.second, this); + auto p (lookup (var)); + return lookup_type (p.first, &p.second, this); } - lookup + lookup_type operator[] (const variable* var) const // For cached variables. { assert (var != nullptr); return operator[] (*var); } - lookup + lookup_type operator[] (const string& name) const { const variable* var (ctx != nullptr ? ctx->var_pool.find (name) : nullptr); - return var != nullptr ? operator[] (*var) : lookup (); + return var != nullptr ? operator[] (*var) : lookup_type (); } // If typed is false, leave the value untyped even if the variable is. // The second half of the pair is the storage variable. // pair<const value_data*, const variable&> - find (const variable&, bool typed = true) const; + lookup (const variable&, bool typed = true) const; pair<value_data*, const variable&> - find_to_modify (const variable&, bool typed = true); + lookup_to_modify (const variable&, bool typed = true); // Convert a lookup pointing to a value belonging to this variable map // to its non-const version. Note that this is only safe on the original // values (see find_original()). // value& - modify (const lookup& l) + modify (const lookup_type& l) { assert (l.vars == this); value& r (const_cast<value&> (*l.value)); @@ -1432,7 +1434,7 @@ namespace build2 insert (const variable&, bool typed = true); pair<const_iterator, const_iterator> - find_namespace (const variable& ns) const + lookup_namespace (const variable& ns) const { auto r (m_.find_sub (ns)); return make_pair (const_iterator (r.first, *this), |