diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-23 14:10:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-23 14:10:23 +0100 |
commit | 6dc4b23e2f6dafa68930a0b5c5778485468e3fb4 (patch) | |
tree | fa7f29d4401f7cc4b2e66af0ba25cf6684ffdc39 | |
parent | 7d862dd5fc3a37093462d5ff187403c9ef680a7a (diff) | |
download | serenity-6dc4b23e2f6dafa68930a0b5c5778485468e3fb4.zip |
LibJS: Teach the lexer to recognize ">=" and "<=" :^)
-rw-r--r-- | Libraries/LibJS/Lexer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Lexer.cpp b/Libraries/LibJS/Lexer.cpp index a7564f9b46..15aa4c8026 100644 --- a/Libraries/LibJS/Lexer.cpp +++ b/Libraries/LibJS/Lexer.cpp @@ -93,6 +93,8 @@ Lexer::Lexer(StringView source) s_two_char_tokens.set("??", TokenType::DoubleQuestionMark); s_two_char_tokens.set("**", TokenType::DoubleAsterisk); s_two_char_tokens.set("==", TokenType::EqualsEquals); + s_two_char_tokens.set("<=", TokenType::LessThanEquals); + s_two_char_tokens.set(">=", TokenType::GreaterThanEquals); s_two_char_tokens.set("!=", TokenType::ExclamationMarkEquals); s_two_char_tokens.set("--", TokenType::MinusMinus); s_two_char_tokens.set("++", TokenType::PlusPlus); |