aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-26 13:10:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:40:59 +0200
commit57e2aaa28e19da1cd4e51982f46ef2630739ff8a (patch)
tree138a169b29aad630150906ffb4a8f30a5f9bdf5a /libbuild2/build/script/parser.cxx
parent29c59165396eb842d92367fca74c4e459ea25900 (diff)
Wrap up $<, $> variables and related ($target.path(), hashing, cleanup)
Diffstat (limited to 'libbuild2/build/script/parser.cxx')
-rw-r--r--libbuild2/build/script/parser.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx
index 60000c2..b170088 100644
--- a/libbuild2/build/script/parser.cxx
+++ b/libbuild2/build/script/parser.cxx
@@ -248,7 +248,8 @@ namespace build2
//
void parser::
- execute (const script& s, environment& e, runner& r)
+ execute (const scope& rs, const scope& bs,
+ environment& e, const script& s, runner& r)
{
path_ = nullptr; // Set by replays.
@@ -256,6 +257,12 @@ namespace build2
set_lexer (nullptr);
+ // The script shouldn't be able to modify the scopes.
+ //
+ root_ = const_cast<scope*> (&rs);
+ scope_ = const_cast<scope*> (&bs);
+ pbase_ = scope_->src_path_;
+
script_ = const_cast<script*> (&s);
runner_ = &r;
environment_ = &e;