mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 23:07:35 +00:00
CppLexer: Add token types for ">", ">=", ">>", ">>="
This commit is contained in:
parent
97c4344f33
commit
345b303262
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