summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/CppLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/CppLexer.cpp')
-rw-r--r--Libraries/LibGUI/CppLexer.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp
index 4631a9185e..6f9cc1e101 100644
--- a/Libraries/LibGUI/CppLexer.cpp
+++ b/Libraries/LibGUI/CppLexer.cpp
@@ -342,6 +342,32 @@ Vector<CppToken> CppLexer::lex()
emit_token(CppToken::Type::RightBracket);
continue;
}
+ if (ch == '<') {
+ begin_token();
+ consume();
+ if (peek() == '<') {
+ consume();
+ if (peek() == '=') {
+ consume();
+ commit_token(CppToken::Type::LessLessEquals);
+ continue;
+ }
+ commit_token(CppToken::Type::LessLess);
+ continue;
+ }
+ if (peek() == '=') {
+ consume();
+ commit_token(CppToken::Type::LessEquals);
+ continue;
+ }
+ if (peek() == '>') {
+ consume();
+ commit_token(CppToken::Type::LessGreater);
+ continue;
+ }
+ commit_token(CppToken::Type::Less);
+ continue;
+ }
if (ch == ',') {
emit_token(CppToken::Type::Comma);
continue;
@@ -358,6 +384,10 @@ Vector<CppToken> CppLexer::lex()
emit_token_equals(CppToken::Type::Asterisk, CppToken::Type::AsteriskEquals);
continue;
}
+ if (ch == '%') {
+ emit_token_equals(CppToken::Type::Percent, CppToken::Type::PercentEquals);
+ continue;
+ }
if (ch == '=') {
emit_token_equals(CppToken::Type::Equals, CppToken::Type::EqualsEquals);
continue;