aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/script/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-12-14 14:18:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-12-14 14:18:44 +0200
commit0aa7a94e1032a96a2a72cb6a82824f9fe970d412 (patch)
tree412ab1e9da30c708b616ae6fda1663b8169fc55c /libbuild2/script/parser.cxx
parent218a739b33325c5dd6baa5cf6291dad849ad2441 (diff)
Improve empty simple value to empty list of names reduction heuristics
Specifically, do not reduce typed RHS empty simple values for prepend/append and additionally for assignment provided LHS is typed and is a container.
Diffstat (limited to 'libbuild2/script/parser.cxx')
-rw-r--r--libbuild2/script/parser.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/libbuild2/script/parser.cxx b/libbuild2/script/parser.cxx
index 88e2f06..0be22a6 100644
--- a/libbuild2/script/parser.cxx
+++ b/libbuild2/script/parser.cxx
@@ -1028,7 +1028,7 @@ namespace build2
storage.clear ();
to_stream (os,
- reverse (a.value, storage),
+ reverse (a.value, storage, true /* reduce */),
quote_mode::normal,
'@');
}
@@ -2676,7 +2676,11 @@ namespace build2
if (val.type != nullptr)
{
etype = val.type->element_type;
- untypify (val);
+
+ // Note that here we don't want to be reducing empty simple
+ // values to empty lists.
+ //
+ untypify (val, false /* reduce */);
}
size_t fli (li);