mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00: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);
|
commit_token(CppToken::Type::Less);
|
||||||
continue;
|
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 == ',') {
|
if (ch == ',') {
|
||||||
emit_token(CppToken::Type::Comma);
|
emit_token(CppToken::Type::Comma);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue