mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 19:32:06 -05:00
CppLexer: Add token types for "!", "!=", "~", "?", ":"
This commit is contained in:
parent
29bc978564
commit
95113d15fe
2 changed files with 21 additions and 0 deletions
|
@ -437,6 +437,10 @@ Vector<CppToken> CppLexer::lex()
|
|||
emit_token_equals(CppToken::Type::Caret, CppToken::Type::CaretEquals);
|
||||
continue;
|
||||
}
|
||||
if (ch == '!') {
|
||||
emit_token_equals(CppToken::Type::ExclamationMark, CppToken::Type::ExclamationMarkEquals);
|
||||
continue;
|
||||
}
|
||||
if (ch == '=') {
|
||||
emit_token_equals(CppToken::Type::Equals, CppToken::Type::EqualsEquals);
|
||||
continue;
|
||||
|
@ -473,6 +477,18 @@ Vector<CppToken> CppLexer::lex()
|
|||
commit_token(CppToken::Type::Pipe);
|
||||
continue;
|
||||
}
|
||||
if (ch == '~') {
|
||||
emit_token(CppToken::Type::Tilde);
|
||||
continue;
|
||||
}
|
||||
if (ch == '?') {
|
||||
emit_token(CppToken::Type::QuestionMark);
|
||||
continue;
|
||||
}
|
||||
if (ch == ':') {
|
||||
emit_token(CppToken::Type::Colon);
|
||||
continue;
|
||||
}
|
||||
if (ch == ';') {
|
||||
emit_token(CppToken::Type::Semicolon);
|
||||
continue;
|
||||
|
|
|
@ -67,6 +67,8 @@ namespace GUI {
|
|||
__TOKEN(PercentEquals) \
|
||||
__TOKEN(Caret) \
|
||||
__TOKEN(CaretEquals) \
|
||||
__TOKEN(ExclamationMark) \
|
||||
__TOKEN(ExclamationMarkEquals) \
|
||||
__TOKEN(Equals) \
|
||||
__TOKEN(EqualsEquals) \
|
||||
__TOKEN(And) \
|
||||
|
@ -75,6 +77,9 @@ namespace GUI {
|
|||
__TOKEN(Pipe) \
|
||||
__TOKEN(PipePipe) \
|
||||
__TOKEN(PipeEquals) \
|
||||
__TOKEN(Tilde) \
|
||||
__TOKEN(QuestionMark) \
|
||||
__TOKEN(Colon) \
|
||||
__TOKEN(Semicolon) \
|
||||
__TOKEN(DoubleQuotedString) \
|
||||
__TOKEN(SingleQuotedString) \
|
||||
|
|
Loading…
Add table
Reference in a new issue