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
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
Reference in a new issue