1
Fork 0

Correctly handle while-let-chains

This commit is contained in:
sjwang05 2023-11-10 12:13:53 -08:00
parent 9455259450
commit a49368f00b
No known key found for this signature in database
GPG key ID: AB262FD6FFBFCFFE
4 changed files with 51 additions and 4 deletions

View file

@ -129,7 +129,7 @@ impl<'a> TokenTreesReader<'a> {
while parser.token != token::Eof {
if let Err(diff_err) = parser.err_diff_marker() {
diff_errs.push(diff_err);
} else if parser.token.is_keyword(kw::If) {
} else if parser.is_keyword_ahead(0, &[kw::If, kw::While]) {
in_cond = true;
} else if matches!(
parser.token.kind,