1
Fork 0

Auto merge of #117770 - sjwang05:issue-117766, r=estebank,TaKO8Ki

Catch stray `{` in let-chains

Fixes #117766
This commit is contained in:
bors 2023-11-13 01:57:59 +00:00
commit ea1e5cc91f
4 changed files with 184 additions and 20 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(crate) fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool {
self.look_ahead(dist, |t| kws.iter().any(|&kw| t.is_keyword(kw)))
}