From a14b9bc18431c6aed8441261d28b6ff20bd25935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Apr 2019 14:44:32 +0200 Subject: Initial take on header unit and include translation support --- build2/cc/lexer.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build2/cc/lexer.cxx') diff --git a/build2/cc/lexer.cxx b/build2/cc/lexer.cxx index 3c6293a..7795192 100644 --- a/build2/cc/lexer.cxx +++ b/build2/cc/lexer.cxx @@ -323,8 +323,8 @@ namespace build2 t.type = type::punctuation; return; } - case '>': // > >= >> >>= case '<': // < <= << <<= + case '>': // > >= >> >>= { xchar p (peek ()); @@ -333,11 +333,16 @@ namespace build2 geth (p); if ((p = peek ()) == '=') geth (p); + t.type = type::punctuation; } else if (p == '=') + { geth (p); + t.type = type::punctuation; + } + else + t.type = (c == '<' ? type::less : type::greater); - t.type = type::punctuation; return; } case '+': // + ++ += @@ -1102,6 +1107,8 @@ namespace build2 { case type::dot: o << "'.'"; break; case type::semi: o << "';'"; break; + case type::less: o << "'<'"; break; + case type::greater: o << "'>'"; break; case type::lcbrace: o << "'{'"; break; case type::rcbrace: o << "'}'"; break; case type::punctuation: o << ""; break; -- cgit v1.1