Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov"

This reverts commit 85cee57fd7, reversing
changes made to b4d3873024.
This commit is contained in:
Tyler Mandry 2020-09-10 02:18:46 +00:00
parent 97eb606e4b
commit fdff7defc9
4 changed files with 16 additions and 25 deletions

View file

@ -262,7 +262,10 @@ impl<'a> TokenTreesReader<'a> {
}
_ => {
let tt = TokenTree::Token(self.token.take());
let is_joint = self.bump();
let mut is_joint = self.bump();
if !self.token.is_op() {
is_joint = NonJoint;
}
Ok((tt, is_joint))
}
}

View file

@ -822,15 +822,15 @@ impl<'a> Parser<'a> {
}
let frame = &self.token_cursor.frame;
match frame.tree_cursor.look_ahead(dist - 1) {
looker(&match frame.tree_cursor.look_ahead(dist - 1) {
Some(tree) => match tree {
TokenTree::Token(token) => looker(token),
TokenTree::Token(token) => token,
TokenTree::Delimited(dspan, delim, _) => {
looker(&Token::new(token::OpenDelim(delim.clone()), dspan.open))
Token::new(token::OpenDelim(delim), dspan.open)
}
},
None => looker(&Token::new(token::CloseDelim(frame.delim), frame.span.close)),
}
None => Token::new(token::CloseDelim(frame.delim), frame.span.close),
})
}
/// Returns whether any of the given keywords are `dist` tokens ahead of the current one.