LibJS: Add support for arrow functions

This commit is contained in:
Jack Karamanian 2020-03-30 08:26:09 -05:00 committed by Andreas Kling
commit 098f1cd0ca
Notes: sideshowbarker 2024-07-19 08:03:01 +09:00
5 changed files with 144 additions and 1 deletions

View file

@ -86,6 +86,7 @@ Lexer::Lexer(StringView source)
}
if (s_two_char_tokens.is_empty()) {
s_two_char_tokens.set("=>", TokenType::Arrow);
s_two_char_tokens.set("+=", TokenType::PlusEquals);
s_two_char_tokens.set("-=", TokenType::MinusEquals);
s_two_char_tokens.set("*=", TokenType::AsteriskEquals);