aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-11-18 08:00:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-11-19 13:00:11 +0200
commit6a2d1e3062964fc16cfbc43bc69284f854c35dca (patch)
tree33b10d64adaa01d6afd58f121cb77bdde53d4116 /libbuild2/cc/lexer.cxx
parentf91468192ad7066a5e6fa63ddc4e4231e632a457 (diff)
Handle C++20 module partitions in scanner
Diffstat (limited to 'libbuild2/cc/lexer.cxx')
-rw-r--r--libbuild2/cc/lexer.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbuild2/cc/lexer.cxx b/libbuild2/cc/lexer.cxx
index 123a41e..beeb970 100644
--- a/libbuild2/cc/lexer.cxx
+++ b/libbuild2/cc/lexer.cxx
@@ -377,9 +377,13 @@ namespace build2
xchar p (peek ());
if (p == ':')
+ {
geth (p);
+ t.type = type::scope;
+ }
+ else
+ t.type = type::colon;
- t.type = type::punctuation;
return;
}
// Number (and also .<N> above).
@@ -1158,6 +1162,8 @@ namespace build2
{
case type::dot: o << "'.'"; break;
case type::semi: o << "';'"; break;
+ case type::colon: o << "':'"; break;
+ case type::scope: o << "'::'"; break;
case type::less: o << "'<'"; break;
case type::greater: o << "'>'"; break;
case type::lcbrace: o << "'{'"; break;