aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/script.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-10 18:22:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-10 18:22:31 +0200
commit19af3f6b0873a92582e4787a87a6f14df53ff6ae (patch)
tree7545e80d9348eb7808e1c894cd111ab46cc8a9a5 /libbuild2/build/script/script.cxx
parent9f95a23eae04680559a9cb943fdfaa00f52cd66e (diff)
Preparatory work for public/private variable distinction
We still always use the public var_pool from context but where required, all access now goes through scope::var_pool().
Diffstat (limited to 'libbuild2/build/script/script.cxx')
-rw-r--r--libbuild2/build/script/script.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx
index a557065..2e777b4 100644
--- a/libbuild2/build/script/script.cxx
+++ b/libbuild2/build/script/script.cxx
@@ -28,6 +28,7 @@ namespace build2
environment::
environment (action a,
const target_type& t,
+ const scope_type& s,
bool temp,
const optional<timestamp>& dl)
: build2::script::environment (
@@ -39,7 +40,8 @@ namespace build2
redirect (redirect_type::merge, 2),
redirect (redirect_type::pass)),
target (t),
- vars (context, false /* global */),
+ scope (s),
+ vars (context, false /* shared */), // Note: managed.
var_ts (var_pool.insert (">")),
var_ps (var_pool.insert ("<")),
script_deadline (to_deadline (dl, false /* success */))
@@ -233,7 +235,7 @@ namespace build2
// in parallel). Plus, if there is no such variable, then we cannot
// possibly find any value.
//
- const variable* pvar (context.var_pool.find (n));
+ const variable* pvar (scope.var_pool ().find (n));
if (pvar == nullptr)
return lookup_type ();