Tweak Parser::look_ahead.

It doesn't really matter what the `desugar_doc_comments` argument is
here, because in practice we never look ahead through doc comments.
Changing it to `cursor.desugar_doc_comments` will allow some follow-up
simplifications.
This commit is contained in:
Nicholas Nethercote 2023-07-26 09:17:16 +10:00
parent 39d51bd51c
commit 395e95c490

View file

@ -1155,7 +1155,7 @@ impl<'a> Parser<'a> {
let mut i = 0;
let mut token = Token::dummy();
while i < dist {
token = cursor.next(/* desugar_doc_comments */ false).0;
token = cursor.next(cursor.desugar_doc_comments).0;
if matches!(
token.kind,
token::OpenDelim(Delimiter::Invisible) | token::CloseDelim(Delimiter::Invisible)