mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
CppLexer: Add token types for ">", ">=", ">>", ">>="
This commit is contained in:
parent
97c4344f33
commit
345b303262
Notes:
sideshowbarker
2024-07-19 04:35:17 +09:00
Author: https://github.com/nico
Commit: 345b303262
Pull-request: https://github.com/SerenityOS/serenity/pull/2893
1 changed files with 21 additions and 0 deletions
|
@ -368,6 +368,27 @@ Vector<CppToken> CppLexer::lex()
|
|||
commit_token(CppToken::Type::Less);
|
||||
continue;
|
||||
}
|
||||
if (ch == '>') {
|
||||
begin_token();
|
||||
consume();
|
||||
if (peek() == '>') {
|
||||
consume();
|
||||
if (peek() == '=') {
|
||||
consume();
|
||||
commit_token(CppToken::Type::GreaterGreaterEquals);
|
||||
continue;
|
||||
}
|
||||
commit_token(CppToken::Type::GreaterGreater);
|
||||
continue;
|
||||
}
|
||||
if (peek() == '=') {
|
||||
consume();
|
||||
commit_token(CppToken::Type::GreaterEquals);
|
||||
continue;
|
||||
}
|
||||
commit_token(CppToken::Type::Greater);
|
||||
continue;
|
||||
}
|
||||
if (ch == ',') {
|
||||
emit_token(CppToken::Type::Comma);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue