aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-05-26 10:07:56 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-05-26 10:07:56 -0700
commit2fc4a5c5646fcd9bb12e089ae259cc1ee8099baf (patch)
tree0fcfef183416b8ba28dc1e55bbc612f2be7ed2f8 /src
parent657903c03e46a1f3a3b30adc1677e3fb30093f0a (diff)
downloadbun-2fc4a5c5646fcd9bb12e089ae259cc1ee8099baf.tar.gz
bun-2fc4a5c5646fcd9bb12e089ae259cc1ee8099baf.tar.zst
bun-2fc4a5c5646fcd9bb12e089ae259cc1ee8099baf.zip
lexer bug!
Former-commit-id: 84472ed57fbe1999e5fe88e6c4df4e28efd9c3e6
Diffstat (limited to 'src')
-rw-r--r--src/js_lexer.zig21
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;
},