aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-06-08 15:30:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-06-08 15:43:08 +0200
commitf8e6ed173b9b77ec7ac1b0d39ae83f29fb9468a9 (patch)
treec8f22a50c6df6070105fda88a7800c2b51332d23 /libbuild2/build/script/parser.hxx
parent5900f155a4a0da88cfd56bedccef0c74cc19c9f7 (diff)
Redo low verbosity diagnostic deduction to use scope instead of target
Diffstat (limited to 'libbuild2/build/script/parser.hxx')
-rw-r--r--libbuild2/build/script/parser.hxx16
1 files changed, 13 insertions, 3 deletions
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<action, 1>&,
+ pre_parse (const scope&, const small_vector<action, 1>&,
istream&, const path_name&, uint64_t line,
optional<string> diag_name, const location& diag_loc);