diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-07 23:07:57 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-08 02:07:18 -0500 |
| commit | e5f2fac8c5ae5a1b74335816836872c2e24904e6 (patch) | |
| tree | ed131049d39320967d8d18f65749c08ebb2f79a0 /compiler/lexer.cup | |
| parent | Mark bootstrap files as binary in `.gitattributes` (diff) | |
| download | cup-master.tar.xz cup-master.zip | |
Diffstat (limited to 'compiler/lexer.cup')
| -rw-r--r-- | compiler/lexer.cup | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/lexer.cup b/compiler/lexer.cup index 9e967f8..e6d0c0b 100644 --- a/compiler/lexer.cup +++ b/compiler/lexer.cup @@ -138,12 +138,16 @@ fn lexer_next(lexer: Lexer*, token: Token*) { } else if (c == '<') { + if (lexer_peek_char(lexer, 1) == '<') + return lexer_make_token(lexer, token, TOKEN_LSHIFT, 2); if (lexer_peek_char(lexer, 1) == '=') return lexer_make_token(lexer, token, TOKEN_LEQ, 2); return lexer_make_token(lexer, token, TOKEN_LT, 1); } else if (c == '>') { + if (lexer_peek_char(lexer, 1) == '>') + return lexer_make_token(lexer, token, TOKEN_RSHIFT, 2); if (lexer_peek_char(lexer, 1) == '=') return lexer_make_token(lexer, token, TOKEN_GEQ, 2); return lexer_make_token(lexer, token, TOKEN_GT, 1); |