aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-06-16 17:08:39 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-06-18 14:18:59 +0300
commit728b075cb5e0df9c386f8377e0f6961e5ccc5143 (patch)
tree8bd60cb16a260031d46b5d79adab5821dac3dd27 /libbuild2/build/script/parser.cxx
parent448747903956f70f85f5135a224bbbae7f7b276a (diff)
Add env script pseudo-builtin
Also disable C++ recipe tests when cross-testing.
Diffstat (limited to 'libbuild2/build/script/parser.cxx')
-rw-r--r--libbuild2/build/script/parser.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx
index 2c41ac1..8f2c46d 100644
--- a/libbuild2/build/script/parser.cxx
+++ b/libbuild2/build/script/parser.cxx
@@ -330,6 +330,7 @@ namespace build2
optional<process_path> parser::
parse_program (token& t, build2::script::token_type& tt,
bool first,
+ bool env,
names& ns)
{
const location l (get_location (t));
@@ -369,13 +370,16 @@ namespace build2
// Verify that the special builtin is not called inside an improper
// context (flow control construct or complex expression).
//
- auto verify = [first, &v, &l, this] ()
+ auto verify = [first, env, &v, &l, this] ()
{
if (level_ != 0)
fail (l) << "'" << v << "' call inside flow control construct";
if (!first)
fail (l) << "'" << v << "' call must be the only command";
+
+ if (env)
+ fail (l) << "'" << v << "' call via 'env' builtin";
};
if (v == "diag")