diff options
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r-- | libbuild2/parser.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index d457c68..a8abbfb 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -2141,7 +2141,7 @@ namespace build2 // multiple `case`s per line/block) optionally followed by the `default` // lines/blocks followed by the closing `}`. // - bool taken (false); // One of the cases/default has been taken. + bool taken (false); // One of the case/default has been taken. bool seen_default (false); auto special = [&seen_default, this] (const token& t, const type& tt) @@ -2279,6 +2279,16 @@ namespace build2 break; } + // We reserve the ':' separator for possible future match + // extraction support: + // + // case '...': x + // info "$x" + // + if (tt == type::colon) + fail (t) << "unexpected ':' (match extraction is not yet " + << "supported)"; + if (tt != type::comma) break; } |