diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp index 0a34b98e18..5f6507b1e0 100644 --- a/Libraries/LibGUI/CppLexer.cpp +++ b/Libraries/LibGUI/CppLexer.cpp @@ -422,6 +422,11 @@ Vector CppLexer::lex() commit_token(CppToken::Type::MinusEquals); continue; } + if (peek() == '>') { + consume(); + commit_token(CppToken::Type::Arrow); + continue; + } commit_token(CppToken::Type::Minus); continue; } @@ -493,6 +498,10 @@ Vector CppLexer::lex() emit_token(CppToken::Type::Semicolon); continue; } + if (ch == '.') { + emit_token(CppToken::Type::Dot); + continue; + } if (ch == '#') { begin_token(); consume(); diff --git a/Libraries/LibGUI/CppLexer.h b/Libraries/LibGUI/CppLexer.h index 80d468f216..8e2a6b99c4 100644 --- a/Libraries/LibGUI/CppLexer.h +++ b/Libraries/LibGUI/CppLexer.h @@ -81,6 +81,8 @@ namespace GUI { __TOKEN(QuestionMark) \ __TOKEN(Colon) \ __TOKEN(Semicolon) \ + __TOKEN(Dot) \ + __TOKEN(Arrow) \ __TOKEN(DoubleQuotedString) \ __TOKEN(SingleQuotedString) \ __TOKEN(EscapeSequence) \