aboutsummaryrefslogtreecommitdiff
path: root/build2/parser.cxx
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/parser.cxx
parent4461d80e680bc81eaad28bac58015660f5bc105e (diff)
Make name::pair char again
The plan is to represent scope/target-qualified variables as ':'-style pairs.
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r--build2/parser.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index ce5b968..f7b17b2 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -991,6 +991,9 @@ namespace build2
if (i->pair)
{
+ if (i->pair != '@')
+ fail << "unexpected pair style in using directive";
+
++i;
if (!i->simple ())
fail (l) << "module version expected instead of " << *i;
@@ -1547,6 +1550,9 @@ namespace build2
if (i->pair)
{
+ if (i->pair != '=')
+ fail << "unexpected pair style in attributes";
+
try
{
v = convert<string> (move (*++i));
@@ -2178,7 +2184,8 @@ namespace build2
if (pair != 0)
fail (t) << "nested pair on the right hand side of a pair";
- // Catch '@@'. Maybe we can use for something later (e.g., escaping).
+ // Catch double pair separator ('@@'). Maybe we can use for something
+ // later (e.g., escaping).
//
if (!ns.empty () && ns.back ().pair)
fail (t) << "double pair separator";
@@ -2197,7 +2204,7 @@ namespace build2
else if (count > 1)
fail (t) << "multiple names on the left hand side of a pair";
- ns.back ().pair = true;
+ ns.back ().pair = lexer_->pair_separator ();
tt = peek ();
// If the next token is separated, then we have an empty RHS. Note
@@ -2527,6 +2534,9 @@ namespace build2
dir_path src_base;
if (i->pair)
{
+ if (i->pair != '@')
+ fail << "unexpected pair style in buildspec";
+
if (i->typed ())
fail (l) << "expected target src_base instead of " << *i;