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

@ -1115,7 +1115,7 @@ impl<'a> Parser<'a> {
}
/// Returns whether any of the given keywords are `dist` tokens ahead of the current one.
fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool {
pub fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool {
self.look_ahead(dist, |t| kws.iter().any(|&kw| t.is_keyword(kw)))
}