aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-11-24 18:09:35 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-11-25 14:15:43 +0300
commit472d6d0e49c0114f46ff31267d09acdbf9fba421 (patch)
tree9edfc26e77edabee872c625eb5b96e845b7b4654 /libbuild2/build/script/parser.cxx
parentf8408539216cc213fa780560b7396af8ba801e2e (diff)
Use operation name as a buildscript name if unable to deduce
Diffstat (limited to 'libbuild2/build/script/parser.cxx')
-rw-r--r--libbuild2/build/script/parser.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx
index 5dd9179..df0a419 100644
--- a/libbuild2/build/script/parser.cxx
+++ b/libbuild2/build/script/parser.cxx
@@ -102,15 +102,22 @@ namespace build2
info << "consider using 'depdb' builtin to track its value "
<< "changes";
- // Diagnose absent/ambigous script name.
+ // Diagnose absent/ambiguous script name. But try to deduce an absent
+ // name from the script operation first.
//
{
diag_record dr;
if (!diag_name_ && diag_preamble_.empty ())
{
- dr << fail (s.start_loc)
- << "unable to deduce low-verbosity script diagnostics name";
+ if (as.size () == 1)
+ {
+ diag_name_ = make_pair (ctx->operation_table[as[0].operation ()],
+ location ());
+ }
+ else
+ dr << fail (s.start_loc)
+ << "unable to deduce low-verbosity script diagnostics name";
}
else if (diag_name2_)
{