diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-01 09:49:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-01 09:49:18 +0200 |
commit | 26146d391f179dd9e4e5e1f70a52ba99d6a0847d (patch) | |
tree | c79762ff1fd15bfa25fdeacf9f9e6efe338354bf /build2/variable | |
parent | 7253ffee27f6cae34e63a72b2d3d10db10571ecc (diff) |
Get part of variable override implementation
Diffstat (limited to 'build2/variable')
-rw-r--r-- | build2/variable | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/build2/variable b/build2/variable index 15f9c47..d22d6da 100644 --- a/build2/variable +++ b/build2/variable @@ -79,6 +79,10 @@ namespace build2 // // @@ Document override semantics. // + // Note that we don't propagate variable type to override variables and we + // keep override values as untyped names. So they get "typed" when they are + // applied. + // struct variable { string name; @@ -111,7 +115,7 @@ namespace build2 // Creation. A newly created value is NULL and can be reset back to NULL // by assigning nullptr. Values can be copied and copy-assigned. Note that - // for assignment, the values' types should be the same of LHS should be + // for assignment, the values' types should be the same or LHS should be // untyped. // // @@ -672,6 +676,17 @@ namespace build2 lookup find (const target_type&, const string& tname, const variable&) const; }; + + // Override cache. + // + struct variable_override_value + { + build2::value value; + const variable_map* stem_vars = nullptr; // NULL means there is no stem. + }; + + extern std::map<const variable_map*, + variable_override_value> variable_override_cache; } #include <build2/variable.ixx> |