diff options
author | 2021-05-26 10:07:56 -0700 | |
---|---|---|
committer | 2021-05-26 10:07:56 -0700 | |
commit | 84472ed57fbe1999e5fe88e6c4df4e28efd9c3e6 (patch) | |
tree | 0fcfef183416b8ba28dc1e55bbc612f2be7ed2f8 | |
parent | d04ef8c53f7054ed51f0d677b304b5da559cea14 (diff) | |
download | bun-84472ed57fbe1999e5fe88e6c4df4e28efd9c3e6.tar.gz bun-84472ed57fbe1999e5fe88e6c4df4e28efd9c3e6.tar.zst bun-84472ed57fbe1999e5fe88e6c4df4e28efd9c3e6.zip |
lexer bug!
-rw-r--r-- | src/js_lexer.zig | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/js_lexer.zig b/src/js_lexer.zig index f90e60883..43f3fb56a 100644 --- a/src/js_lexer.zig +++ b/src/js_lexer.zig @@ -867,7 +867,7 @@ pub const Lexer = struct { } } - pub fn expectLessThan(lexer: *LexerType, is_inside_jsx_element: bool) !void { + pub fn expectLessThan(lexer: *LexerType, comptime is_inside_jsx_element: bool) !void { switch (lexer.token) { .t_less_than => { if (is_inside_jsx_element) { @@ -895,7 +895,7 @@ pub const Lexer = struct { } } - pub fn expectGreaterThan(lexer: *LexerType, is_inside_jsx_element: bool) !void { + pub fn expectGreaterThan(lexer: *LexerType, comptime is_inside_jsx_element: bool) !void { switch (lexer.token) { .t_greater_than => { if (is_inside_jsx_element) { @@ -904,20 +904,27 @@ pub const Lexer = struct { try lexer.next(); } }, + .t_greater_than_greater_than => { + lexer.token = .t_greater_than; + lexer.start += 1; + }, + + .t_greater_than_greater_than_greater_than => { + lexer.token = .t_greater_than_greater_than; + lexer.start += 1; + }, + .t_greater_than_equals => { lexer.token = .t_equals; lexer.start += 1; try lexer.maybeExpandEquals(); }, - .t_greater_than_greater_than => { - lexer.token = .t_greater_than; - lexer.start += 1; - }, + .t_greater_than_greater_than_equals => { lexer.token = .t_greater_than_greater_than; lexer.start += 1; }, - .t_greater_than_greater_than_greater_than => { + .t_greater_than_greater_than_greater_than_equals => { lexer.token = .t_greater_than_greater_than_equals; lexer.start += 1; }, |