summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/CppLexer.cpp16
-rw-r--r--Libraries/LibGUI/CppLexer.h8
2 files changed, 24 insertions, 0 deletions
diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp
index 8db91f3f23..4631a9185e 100644
--- a/Libraries/LibGUI/CppLexer.cpp
+++ b/Libraries/LibGUI/CppLexer.cpp
@@ -346,10 +346,22 @@ Vector<CppToken> CppLexer::lex()
emit_token(CppToken::Type::Comma);
continue;
}
+ if (ch == '+') {
+ emit_token_equals(CppToken::Type::Plus, CppToken::Type::PlusEquals);
+ continue;
+ }
+ if (ch == '-') {
+ emit_token_equals(CppToken::Type::Minus, CppToken::Type::MinusEquals);
+ continue;
+ }
if (ch == '*') {
emit_token_equals(CppToken::Type::Asterisk, CppToken::Type::AsteriskEquals);
continue;
}
+ if (ch == '=') {
+ emit_token_equals(CppToken::Type::Equals, CppToken::Type::EqualsEquals);
+ continue;
+ }
if (ch == ';') {
emit_token(CppToken::Type::Semicolon);
continue;
@@ -422,6 +434,10 @@ Vector<CppToken> CppLexer::lex()
commit_token(CppToken::Type::Comment);
continue;
}
+ if (ch == '/') {
+ emit_token_equals(CppToken::Type::Slash, CppToken::Type::SlashEquals);
+ continue;
+ }
if (ch == '"') {
begin_token();
consume();
diff --git a/Libraries/LibGUI/CppLexer.h b/Libraries/LibGUI/CppLexer.h
index 7e217c8b10..cc0c76ecb6 100644
--- a/Libraries/LibGUI/CppLexer.h
+++ b/Libraries/LibGUI/CppLexer.h
@@ -44,8 +44,16 @@ namespace GUI {
__TOKEN(LeftBracket) \
__TOKEN(RightBracket) \
__TOKEN(Comma) \
+ __TOKEN(Plus) \
+ __TOKEN(PlusEquals) \
+ __TOKEN(Minus) \
+ __TOKEN(MinusEquals) \
__TOKEN(Asterisk) \
__TOKEN(AsteriskEquals) \
+ __TOKEN(Slash) \
+ __TOKEN(SlashEquals) \
+ __TOKEN(Equals) \
+ __TOKEN(EqualsEquals) \
__TOKEN(Semicolon) \
__TOKEN(DoubleQuotedString) \
__TOKEN(SingleQuotedString) \