aboutsummaryrefslogtreecommitdiff
path: root/build2/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-01 09:49:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-01 09:49:18 +0200
commit26146d391f179dd9e4e5e1f70a52ba99d6a0847d (patch)
treec79762ff1fd15bfa25fdeacf9f9e6efe338354bf /build2/scope
parent7253ffee27f6cae34e63a72b2d3d10db10571ecc (diff)
Get part of variable override implementation
Diffstat (limited to 'build2/scope')
-rw-r--r--build2/scope21
1 files changed, 18 insertions, 3 deletions
diff --git a/build2/scope b/build2/scope
index 6050bf8..b4c4e96 100644
--- a/build2/scope
+++ b/build2/scope
@@ -128,9 +128,24 @@ namespace build2
}
lookup
- find (const variable&,
- const target_type* tt, const string* tn,
- const target_type* gt = nullptr, const string* gn = nullptr) const;
+ find (const variable& var, const target_type* tt, const string* tn) const
+ {
+ lookup l (find_original (var, tt, tn));
+ return var.override == nullptr
+ ? l
+ : find_override (var, move (l), false);
+ }
+
+ // Implementation details (used by target lookup).
+ //
+ lookup
+ 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;
// Return a value suitable for assignment (or append if you only
// want to append to the value from this scope). If the variable