Factor out repeated code from eat_dollar.

This commit is contained in:
Nicholas Nethercote 2024-12-11 15:21:54 +11:00
parent c82d5865f2
commit fd83954d66

View file

@ -275,8 +275,7 @@ fn eat_dollar<'psess>(
psess: &'psess ParseSess,
span: Span,
) -> PResult<'psess, ()> {
if let Some(TokenTree::Token(Token { kind: token::Dollar, .. }, _)) = iter.peek() {
let _ = iter.next();
if try_eat_dollar(iter) {
return Ok(());
}
Err(psess.dcx().struct_span_err(