diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-12 14:51:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 08:05:07 +0200 |
commit | 8d2e541ab1aa24140eb680fb046e49a4a3f0bbd2 (patch) | |
tree | 57401f85aeaa2e3d53534bcb9df007dffafccbac /build2/target | |
parent | 04e382b0af66057f19c6dce66c43316cbd3cb23c (diff) |
Various design/implementation cleanups
Diffstat (limited to 'build2/target')
-rw-r--r-- | build2/target | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/build2/target b/build2/target index 681fcee..8fc0e8c 100644 --- a/build2/target +++ b/build2/target @@ -359,7 +359,7 @@ namespace build2 lookup operator[] (const string& name) const { - return operator[] (var_pool.find (name)); + return operator[] (var_pool[name]); } // As above but also return the depth at which the value is found. The @@ -370,6 +370,7 @@ namespace build2 // that given two lookups from the same target, we can say which one came // earlier. If no value is found, then the depth is set to ~0. // + // pair<lookup, size_t> find (const variable& var) const { @@ -380,10 +381,13 @@ namespace build2 } pair<lookup, size_t> - find (const string& name) const {return find (var_pool.find (name));} + find (const string& name) const {return find (var_pool[name]);} + // If target_only is true, then only look in target and its target group + // without continuing in scopes. + // pair<lookup, size_t> - find_original (const variable&) const; + find_original (const variable&, bool target_only = false) const; // Return a value suitable for assignment. See scope for details. // @@ -409,7 +413,7 @@ namespace build2 value& append (const string& name) { - return append (var_pool.find (name)); + return append (var_pool[name]); } public: |