Remove an unnecessary ForceCollect::Yes.

No need to collect tokens on this recovery path, because the parsed
statement isn't even looked at.
This commit is contained in:
Nicholas Nethercote
2024-07-17 02:21:39 +10:00
parent 5affbb1715
commit e69ff1c106

View File

@@ -942,11 +942,10 @@ impl<'a> Parser<'a> {
let initial_semicolon = self.token.span;
while self.eat(&TokenKind::Semi) {
let _ =
self.parse_stmt_without_recovery(false, ForceCollect::Yes).unwrap_or_else(|e| {
e.cancel();
None
});
let _ = self.parse_stmt_without_recovery(false, ForceCollect::No).unwrap_or_else(|e| {
e.cancel();
None
});
}
expect_err