From 49c6210a1ae21b6722d513bd35ba90ee1fec3170 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 May 2020 15:44:32 +0200 Subject: Integrate buildscript running into recipe default_action() --- libbuild2/build/script/parser.hxx | 3 +++ libbuild2/build/script/runner.cxx | 8 ++++---- libbuild2/build/script/script.cxx | 9 ++++++--- libbuild2/build/script/script.hxx | 3 +++ 4 files changed, 16 insertions(+), 7 deletions(-) (limited to 'libbuild2/build') diff --git a/libbuild2/build/script/parser.hxx b/libbuild2/build/script/parser.hxx index c88898b..40f4c62 100644 --- a/libbuild2/build/script/parser.hxx +++ b/libbuild2/build/script/parser.hxx @@ -30,6 +30,9 @@ namespace build2 public: parser (context& c): build2::script::parser (c) {} + // Note that the returned script object references the passed path + // name. + // script pre_parse (istream&, const path_name&, uint64_t line); diff --git a/libbuild2/build/script/runner.cxx b/libbuild2/build/script/runner.cxx index f52d1c0..94f1394 100644 --- a/libbuild2/build/script/runner.cxx +++ b/libbuild2/build/script/runner.cxx @@ -29,8 +29,8 @@ namespace build2 size_t li, const location& ll) { - if (verb >= 3) - text << ": " << expr; + if (verb >= 2) + text << expr; build2::script::run (env, expr, li, ll); } @@ -40,8 +40,8 @@ namespace build2 const command_expr& expr, size_t li, const location& ll) { - if (verb >= 3) - text << ": ?" << expr; + if (verb >= 2) + text << expr; return build2::script::run_if (env, expr, li, ll); } diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx index eb5b78c..5dbd24c 100644 --- a/libbuild2/build/script/script.cxx +++ b/libbuild2/build/script/script.cxx @@ -33,12 +33,15 @@ namespace build2 // Set the $> variable. // { - value& v (assign (var_pool.insert (">"))); + //@@ TODO + // + value& v (assign (var_pool.insert (">"))); if (auto* t = pt.is_a ()) - v = t->path (); + v = t->path ().string (); else - fail << "target " << pt << " is not path-based"; + //fail << "target " << pt << " is not path-based"; + v = pt.name; //@@ TMP } } diff --git a/libbuild2/build/script/script.hxx b/libbuild2/build/script/script.hxx index 6beb5a4..dfd725b 100644 --- a/libbuild2/build/script/script.hxx +++ b/libbuild2/build/script/script.hxx @@ -37,6 +37,9 @@ namespace build2 location end_loc; }; + //@@ Does environment need script? Can't we just pass it to parser along + // with environment. + // class environment: public build2::script::environment { public: -- cgit v1.1