fix(token): Improve email detection by prefering that over base64

Found in #1282
This commit is contained in:
Ed Page
2025-04-23 13:42:12 -05:00
parent 25bb8ee3b4
commit e30fd36452
+4 -14
View File
@@ -188,15 +188,15 @@ mod parser {
// - Update `is_ignore_char` to make sure `sep1` doesn't eat it all up
// - Make sure you always consume it
terminated(uuid_literal, peek(sep1)),
terminated(hash_literal, peek(sep1)),
terminated(email_literal, peek(sep1)),
terminated(url_literal, peek(sep1)),
terminated(jwt, peek(sep1)),
terminated(base64_literal, peek(sep1)), // base64 should be quoted or something
terminated(hash_literal, peek(sep1)),
terminated(ordinal_literal, peek(sep1)),
terminated(hex_literal, peek(sep1)),
terminated(dec_literal, peek(sep1)), // Allow digit-prefixed words
terminated(email_literal, peek(sep1)),
terminated(url_literal, peek(sep1)),
terminated(css_color, peek(sep1)),
terminated(jwt, peek(sep1)),
c_escape,
printf,
other,
@@ -1664,11 +1664,6 @@ mod test {
case: None,
offset: 0,
},
Identifier {
token: "nam",
case: None,
offset: 38,
},
Identifier {
token: "Bye",
case: None,
@@ -1688,11 +1683,6 @@ mod test {
case: None,
offset: 0,
},
Identifier {
token: "nam",
case: None,
offset: 38,
},
Identifier {
token: "Bye",
case: None,