diff options
Diffstat (limited to 'Libraries/LibGUI/CppLexer.cpp')
-rw-r--r-- | Libraries/LibGUI/CppLexer.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp index 0a812a134c..c1f8853519 100644 --- a/Libraries/LibGUI/CppLexer.cpp +++ b/Libraries/LibGUI/CppLexer.cpp @@ -413,6 +413,38 @@ Vector<CppToken> CppLexer::lex() emit_token_equals(CppToken::Type::Equals, CppToken::Type::EqualsEquals); continue; } + if (ch == '&') { + begin_token(); + consume(); + if (peek() == '&') { + consume(); + commit_token(CppToken::Type::AndAnd); + continue; + } + if (peek() == '=') { + consume(); + commit_token(CppToken::Type::AndEquals); + continue; + } + commit_token(CppToken::Type::And); + continue; + } + if (ch == '|') { + begin_token(); + consume(); + if (peek() == '|') { + consume(); + commit_token(CppToken::Type::PipePipe); + continue; + } + if (peek() == '=') { + consume(); + commit_token(CppToken::Type::PipeEquals); + continue; + } + commit_token(CppToken::Type::Pipe); + continue; + } if (ch == ';') { emit_token(CppToken::Type::Semicolon); continue; |