From 3a2969cf54fb21273b7949095c709f6aa9a2a6d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Oct 2021 10:39:50 +0200 Subject: Pass along parse_names_result during script command parsing --- libbuild2/build/script/parser.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libbuild2/build/script/parser.cxx') diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx index e55eca1..217fa11 100644 --- a/libbuild2/build/script/parser.cxx +++ b/libbuild2/build/script/parser.cxx @@ -356,9 +356,8 @@ namespace build2 optional parser:: parse_program (token& t, build2::script::token_type& tt, - bool first, - bool env, - names& ns) + bool first, bool env, + names& ns, parse_names_result& pr) { const location l (get_location (t)); @@ -588,7 +587,6 @@ namespace build2 << "with the 'diag' builtin"; }; - parse_names_result pr; { // During pre-parse, if the script name is not set manually we // suspend pre-parse, parse the command names for real and try to @@ -692,10 +690,12 @@ namespace build2 // syntactic cases to the typed ones. // names pp_ns; + const value_type* pp_vt (nullptr); if (pr.type == &value_traits::value_type || pr.type == &value_traits::value_type) { pp_ns = move (ns); + pp_vt = pr.type; ns.clear (); } else if (ns[0].file ()) @@ -711,9 +711,9 @@ namespace build2 ns.erase (b, i); - pr.type = i != b + 1 - ? &value_traits::value_type - : &value_traits::value_type; + pp_vt = (i != b + 1 + ? &value_traits::value_type + : &value_traits::value_type); } } @@ -723,7 +723,7 @@ namespace build2 // $cxx.path ... // }} // - if (pr.type == &value_traits::value_type) + if (pp_vt == &value_traits::value_type) { auto pp (convert (move (pp_ns))); @@ -737,7 +737,7 @@ namespace build2 else return optional (move (pp)); } - else if (pr.type == &value_traits::value_type) + else if (pp_vt == &value_traits::value_type) { auto pp (convert (move (pp_ns))); -- cgit v1.1