aboutsummaryrefslogtreecommitdiff
path: root/build2/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-02 09:06:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-02 09:06:26 +0200
commit54fb34bb1ccfac35addd381921be316302276b1b (patch)
tree96f34e4efb2e8ff7742b417f0591e8d57ae441ff /build2/scope
parent175437114658325674a9fec4ea49703e192c4ffc (diff)
Add notion of lookup depth, fix bug with NULL overrides
Diffstat (limited to 'build2/scope')
-rw-r--r--build2/scope16
1 files changed, 9 insertions, 7 deletions
diff --git a/build2/scope b/build2/scope
index b4c4e96..0e1bae5 100644
--- a/build2/scope
+++ b/build2/scope
@@ -130,22 +130,24 @@ namespace build2
lookup
find (const variable& var, const target_type* tt, const string* tn) const
{
- lookup l (find_original (var, tt, tn));
+ auto p (find_original (var, tt, tn));
return var.override == nullptr
- ? l
- : find_override (var, move (l), false);
+ ? p.first
+ : find_override (var, move (p), false).first;
}
- // Implementation details (used by target lookup).
+ // Implementation details (used by scope target lookup).
//
- lookup
+ pair<lookup, size_t>
find_original (
const variable&,
const target_type* tt, const string* tn,
const target_type* gt = nullptr, const string* gn = nullptr) const;
- lookup
- find_override (const variable&, lookup&& original, bool orig_tspec) const;
+ pair<lookup, size_t>
+ find_override (const variable&,
+ pair<lookup, size_t>&& original,
+ bool target) const;
// Return a value suitable for assignment (or append if you only
// want to append to the value from this scope). If the variable