diff options
author | Nico Weber <thakis@chromium.org> | 2020-07-26 16:37:40 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-27 01:04:17 +0200 |
commit | 345b303262710cd66e4d3b98f364182b0ed96dc8 (patch) | |
tree | 0f58c4ab53ca4d972d168ecb3d1ee72d51d627d4 | |
parent | 97c4344f33ba1e030c0ebe657b550127b27f93b5 (diff) | |
download | serenity-345b303262710cd66e4d3b98f364182b0ed96dc8.zip |
CppLexer: Add token types for ">", ">=", ">>", ">>="
-rw-r--r-- | Libraries/LibGUI/CppLexer.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp index 6f9cc1e101..0a812a134c 100644 --- a/Libraries/LibGUI/CppLexer.cpp +++ b/Libraries/LibGUI/CppLexer.cpp @@ -368,6 +368,27 @@ Vector<CppToken> 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; |