From 345b303262710cd66e4d3b98f364182b0ed96dc8 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 26 Jul 2020 16:37:40 -0400 Subject: [PATCH] CppLexer: Add token types for ">", ">=", ">>", ">>=" --- Libraries/LibGUI/CppLexer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp index 6f9cc1e1016..0a812a134c4 100644 --- a/Libraries/LibGUI/CppLexer.cpp +++ b/Libraries/LibGUI/CppLexer.cpp @@ -368,6 +368,27 @@ Vector CppLexer::lex() commit_token(CppToken::Type::Less); continue; } + if (ch == '>') { + begin_token(); + consume(); + if (peek() == '>') { + consume(); + if (peek() == '=') { + consume(); + commit_token(CppToken::Type::GreaterGreaterEquals); + continue; + } + commit_token(CppToken::Type::GreaterGreater); + continue; + } + if (peek() == '=') { + consume(); + commit_token(CppToken::Type::GreaterEquals); + continue; + } + commit_token(CppToken::Type::Greater); + continue; + } if (ch == ',') { emit_token(CppToken::Type::Comma); continue;