Fix parse_fstring

This commit is contained in:
yt2b 2024-01-20 15:27:41 +09:00
parent 8731e9fc50
commit bc16c9fd8d

View file

@ -503,7 +503,11 @@ impl<'a> StringParser<'a> {
}
'\\' if !self.kind.is_raw() => {
self.next_char();
content.push_str(&self.parse_escaped_char()?);
if let Some('{' | '}') = self.peek() {
content.push_str("\\");
} else {
content.push_str(&self.parse_escaped_char()?);
}
}
_ => {
content.push(ch);