aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-02-21 13:55:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-02-21 13:55:45 +0200
commit94b6103c6c3475e3bf10eb905d504a5d239305b7 (patch)
tree12f2ab0906a3208c43a9fa8da713d6f0661c7e78 /libbuild2/parser.cxx
parentde74476b431ce6fab4632a5e94844384acc6e678 (diff)
Improve diagnostics
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 5572104..2623bf3 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -6257,7 +6257,7 @@ namespace build2
type kind)
{
attributes as (attributes_pop ());
- const location& l (as.loc);
+ const location& l (as.loc); // This points to value if no attributes.
// Essentially this is an attribute-augmented assign/append/prepend.
//
@@ -6376,6 +6376,17 @@ namespace build2
}
else
{
+ auto df = make_diag_frame (
+ [this, var, &l](const diag_record& dr)
+ {
+ if (!l.empty ())
+ {
+ dr << info (l);
+ if (var != nullptr) dr << "variable " << var->name << ' ';
+ dr << "value is assigned here";
+ }
+ });
+
if (kind == type::assign)
{
if (rhs)