aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-05 11:29:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-05 11:29:58 +0200
commit86cdcdcf11982281aa286682faf604cff3b1c7d1 (patch)
treeaaecefd0169ad6ef27f375d8a64acd6f30574730 /build2/variable.txx
parent4461d80e680bc81eaad28bac58015660f5bc105e (diff)
Make name::pair char again
The plan is to represent scope/target-qualified variables as ':'-style pairs.
Diffstat (limited to 'build2/variable.txx')
-rw-r--r--build2/variable.txx21
1 files changed, 19 insertions, 2 deletions
diff --git a/build2/variable.txx b/build2/variable.txx
index 721e3c0..bd7a18b 100644
--- a/build2/variable.txx
+++ b/build2/variable.txx
@@ -138,7 +138,18 @@ namespace build2
for (auto i (ns.begin ()); i != ns.end (); ++i)
{
name& n (*i);
- name* r (n.pair ? &*++i : nullptr);
+ name* r (nullptr);
+
+ if (n.pair)
+ {
+ r = &*++i;
+
+ if (n.pair != '@')
+ fail << "unexpected pair style for "
+ << value_traits<T>::value_type.name << " value "
+ << "'" << n << "'" << n.pair << "'" << *r << "' "
+ << "in variable " << var.name;
+ }
try
{
@@ -279,6 +290,12 @@ namespace build2
name& r (*++i); // Got to have the second half of the pair.
+ if (l.pair != '@')
+ fail << "unexpected pair style for "
+ << value_traits<map<K, V>>::value_type.name << " key-value "
+ << "'" << l << "'" << l.pair << "'" << r << "' "
+ << "in variable " << var.name;
+
try
{
K k (value_traits<K>::convert (move (l), nullptr));
@@ -329,7 +346,7 @@ namespace build2
for (const auto& p: vm)
{
s.push_back (value_traits<K>::reverse (p.first));
- s.back ().pair = true;
+ s.back ().pair = '@';
s.push_back (value_traits<V>::reverse (p.second));
}