Graccefully handle overflowing unicode literals

This commit is contained in:
Joshua Warner 2024-12-14 22:04:20 -08:00
parent a83f44188b
commit 6ef87b3b9d
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
11 changed files with 106 additions and 27 deletions

View file

@ -295,7 +295,7 @@ pub fn parse_str_like_literal<'a>() -> impl Parser<'a, StrLikeLiteral<'a>, EStri
// -> TODO: do we want to change this?
// Simply by decoding this, it's guaranteed to be valid utf-8
let text = expr.to_str_in(arena);
let text = expr.to_str_in(arena).map_err(|e| (MadeProgress, e))?;
if text.len() > 5 {
return Err((