Update compiler/parser/src/fstring.rs

Co-authored-by: Zgarbul Andrey <zgarbul.andrey@gmail.com>
This commit is contained in:
Harutaka Kawamura 2022-12-29 08:10:33 +09:00 committed by GitHub
parent 7e8f683808
commit b707f53f23

View file

@ -207,16 +207,14 @@ impl<'a> FStringParser<'a> {
'"' | '\'' => { '"' | '\'' => {
expression.push(ch); expression.push(ch);
loop { loop {
match self.next_char() { let Some(c) = self.next_char() else {
Some(c) => { return Err(UnterminatedString);
};
expression.push(c); expression.push(c);
if c == ch { if c == ch {
break; break;
} }
} }
None => return Err(UnterminatedString),
}
}
} }
' ' if self_documenting => { ' ' if self_documenting => {
trailing_seq.push(ch); trailing_seq.push(ch);