From 57e2aaa28e19da1cd4e51982f46ef2630739ff8a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 May 2020 13:10:37 +0200 Subject: Wrap up $<, $> variables and related ($target.path(), hashing, cleanup) --- libbuild2/build/script/parser.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libbuild2/build/script/parser.cxx') 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 (&rs); + scope_ = const_cast (&bs); + pbase_ = scope_->src_path_; + script_ = const_cast (&s); runner_ = &r; environment_ = &e; -- cgit v1.1