mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
CppLexer: Add token types for "!", "!=", "~", "?", ":"
This commit is contained in:
parent
29bc978564
commit
95113d15fe
Notes:
sideshowbarker
2024-07-19 04:35:00 +09:00
Author: https://github.com/nico
Commit: 95113d15fe
Pull-request: https://github.com/SerenityOS/serenity/pull/2893
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue