aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-15 12:07:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:21 +0200
commit32e60fc5d4e771c5776ddb6715db10e5de182f28 (patch)
treeb91406238fd6cb1f3d727a5e4765e9affce44fb9
parent75665dbe87b97c965eeb5f32b86f526ea8726436 (diff)
Pass test script to parser
-rw-r--r--build2/test/rule.cxx9
-rw-r--r--build2/test/script/parser6
-rw-r--r--build2/test/script/parser.cxx8
3 files changed, 8 insertions, 15 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index f48a3d1..dd1e029 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -13,6 +13,7 @@
#include <build2/test/script/parser>
#include <build2/test/script/runner>
+#include <build2/test/script/script>
using namespace std;
using namespace butl;
@@ -308,6 +309,7 @@ namespace build2
perform_script (action, target& t)
{
using namespace script;
+ using script::script;
for (target* pt: t.prerequisite_targets)
{
@@ -319,11 +321,12 @@ namespace build2
try
{
+ script s (t, st);
+ concurrent_runner r;
+
ifdstream ifs (sp);
parser p;
- concurrent_runner run;
-
- p.parse (ifs, sp, t, st, run);
+ p.parse (ifs, sp, s, r);
}
catch (const io_error& e)
{
diff --git a/build2/test/script/parser b/build2/test/script/parser
index 267c575..732b664 100644
--- a/build2/test/script/parser
+++ b/build2/test/script/parser
@@ -29,11 +29,7 @@ namespace build2
// Issue diagnostics and throw failed in case of an error.
//
void
- parse (istream&,
- const path& name,
- target& test,
- target& script,
- runner&);
+ parse (istream&, const path& name, script&, runner&);
// Recursive descent parser.
//
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index fd8010c..57068c6 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -18,11 +18,7 @@ namespace build2
using type = token_type;
void parser::
- parse (istream& is,
- const path& p,
- target& test_t,
- target& script_t,
- runner& r)
+ parse (istream& is, const path& p, script& s, runner& r)
{
path_ = &p;
@@ -30,9 +26,7 @@ namespace build2
lexer_ = &l;
base_parser::lexer_ = &l;
- script s (test_t, script_t);
script_ = &s;
-
runner_ = &r;
token t;