aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-02-20 09:37:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-02-20 16:01:40 +0200
commit6ff1cf35f78a24d52603d84eac9349b3d4670c6c (patch)
tree3c549345e303b25617b70e96800f8d1fbb7a9595 /libbuild2/variable.hxx
parentc2d2a1ac0ac41a068c4bf09f8236a61d576e74f5 (diff)
Make json value type prepend non-overriding for consistency with map
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r--libbuild2/variable.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx
index b157806..d754edf 100644
--- a/libbuild2/variable.hxx
+++ b/libbuild2/variable.hxx
@@ -1237,6 +1237,12 @@ namespace build2
// of what looks like harmless looseness in a few contexts (such as the
// $json.member_*() functions).
//
+ // Note that similar to map, JSON object append/+= is overriding while
+ // prepend/=+ is not. In a sense, whatever appears last (from left to right)
+ // is kept, which is consistent with what we expect to happen when
+ // specifying the same name repeatedly (provided it's not considered
+ // invalid) in a representation (e.g., {"a":1,"a":2}).
+ //
template <>
struct LIBBUILD2_SYMEXPORT value_traits<json_value>
{