aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-02 17:28:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:37 +0200
commit860750cc3128693ebc5c610855ae7b1ab60cdfc5 (patch)
tree0f3a1aee25844393d902d5a352fded2ca13ca361
parentda6280024e196efb9e55b753751a772e3a844a82 (diff)
Rely on path from replay data in testscript re-parse phase
-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_);