aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/test/script/parser4
-rw-r--r--build2/test/script/parser.cxx9
2 files changed, 8 insertions, 5 deletions
diff --git a/build2/test/script/parser b/build2/test/script/parser
index cff1b39..6e29c9a 100644
--- a/build2/test/script/parser
+++ b/build2/test/script/parser
@@ -37,7 +37,7 @@ namespace build2
void
parse (script& s, runner& r)
{
- parse (s, s.script_target.path (), s, r);
+ parse (s, s, r);
}
// Recursive descent parser.
@@ -49,7 +49,7 @@ namespace build2
//
protected:
void
- parse (scope&, const path& name, script&, runner&);
+ parse (scope&, script&, runner&);
token
pre_parse_scope_body ();
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index 6520458..f07347b 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -71,9 +71,9 @@ namespace build2
}
void parser::
- parse (scope& sc, const path& p, script& s, runner& r)
+ parse (scope& sc, script& s, runner& r)
{
- path_ = &p;
+ path_ = nullptr; // Set by replays.
pre_parse_ = false;
@@ -273,6 +273,7 @@ namespace build2
{
line& l (ls[i]);
+ assert (path_ == nullptr);
replay_data (move (l.tokens)); // Set the tokens and start playing.
// We don't really need to change the mode since we already know
@@ -315,7 +316,9 @@ namespace build2
}
assert (tt == type::newline);
+
replay_stop (); // Stop playing.
+ assert (path_ == nullptr);
}
};
@@ -340,7 +343,7 @@ namespace build2
// scope_ = os;
//
parser p;
- p.parse (*s, *path_, *script_, *runner_);
+ p.parse (*s, *script_, *runner_);
}
play (g->tdown_);