From 6a2d1e3062964fc16cfbc43bc69284f854c35dca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Nov 2020 08:00:16 +0200 Subject: Handle C++20 module partitions in scanner --- libbuild2/cc/lexer.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libbuild2/cc/lexer.cxx') 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 . 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; -- cgit v1.1