diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-18 15:44:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-27 08:35:29 +0200 |
commit | 49c6210a1ae21b6722d513bd35ba90ee1fec3170 (patch) | |
tree | 217a90de6b38631844fe004e335aab0e44267d18 /libbuild2/build/script | |
parent | 5910fbb854d7aa957091aa48a248b2de239eb558 (diff) |
Integrate buildscript running into recipe default_action()
Diffstat (limited to 'libbuild2/build/script')
-rw-r--r-- | libbuild2/build/script/parser.hxx | 3 | ||||
-rw-r--r-- | libbuild2/build/script/runner.cxx | 8 | ||||
-rw-r--r-- | libbuild2/build/script/script.cxx | 9 | ||||
-rw-r--r-- | libbuild2/build/script/script.hxx | 3 |
4 files changed, 16 insertions, 7 deletions
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<path> (">"))); + //@@ TODO + // + value& v (assign (var_pool.insert<string> (">"))); if (auto* t = pt.is_a<path_target> ()) - 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: |