From 860750cc3128693ebc5c610855ae7b1ab60cdfc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2016 17:28:47 +0200 Subject: Rely on path from replay data in testscript re-parse phase --- build2/test/script/parser | 4 ++-- build2/test/script/parser.cxx | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'build2') 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_); -- cgit v1.1