From 26750bd14c715bb616d1779f031b8f5b0ced1bbf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Jun 2021 15:30:35 +0200 Subject: Redo low verbosity diagnostic deduction to use scope instead of target --- libbuild2/build/script/parser.hxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libbuild2/build/script/parser.hxx') diff --git a/libbuild2/build/script/parser.hxx b/libbuild2/build/script/parser.hxx index 8c787f9..948c381 100644 --- a/libbuild2/build/script/parser.hxx +++ b/libbuild2/build/script/parser.hxx @@ -32,11 +32,21 @@ namespace build2 parser (context& c): build2::script::parser (c) {} // Note that the returned script object references the passed path - // name. Target is NULL if this recipe is shared among multiple - // targets. + // name. + // + // Note also that we use the scope to lookup variable values while + // trying to deduce the low verbosity diagnostics name (see code + // around pre_parse_suspended for details). But that means we may + // derive such a name based on the wrong value. This can happen if the + // expanded variable value is reset after the recipe has been + // pre-parsed or if such a value is set on the target (which is where + // we start when looking up variables during the real parse). The + // current thinking is that a remote possibility of this happening is + // acceptable in this situation -- the worst that can happen is that + // we will end up with mismatching diagnostics. // script - pre_parse (const scope&, const target*, const small_vector&, + pre_parse (const scope&, const small_vector&, istream&, const path_name&, uint64_t line, optional diag_name, const location& diag_loc); -- cgit v1.1