diff options
Diffstat (limited to 'libbuild2/scope.hxx')
-rw-r--r-- | libbuild2/scope.hxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libbuild2/scope.hxx b/libbuild2/scope.hxx index 09d61e9..f821411 100644 --- a/libbuild2/scope.hxx +++ b/libbuild2/scope.hxx @@ -190,12 +190,33 @@ namespace build2 // can be used to skip a number of initial lookups. // pair<lookup_type, size_t> - lookup_original (const variable&, + lookup_original (const variable& var, const target_key* tk = nullptr, const target_key* g1k = nullptr, const target_key* g2k = nullptr, - size_t start_depth = 1) const; + size_t start_depth = 1) const + { + return lookup_original_info (var, tk, g1k, g2k, start_depth).lookup; + } + + // As above but also return an indication of whether the resulting value + // was modified by a target type/pattern-specific append/prepend. + // + struct original_info + { + pair<lookup_type, size_t> lookup; + bool modified; + }; + original_info + lookup_original_info (const variable&, + const target_key* tk, + const target_key* g1k = nullptr, + const target_key* g2k = nullptr, + size_t start_depth = 1) const; + + // Implementation details (used by scope target lookup). + // pair<lookup_type, size_t> lookup_override (const variable& var, pair<lookup_type, size_t> original, |