rustc_ast_pretty: Don't print space after $
For example, this code: $arg:expr used to be pretty-printed as: $ arg : expr but is now pretty-printed as: $arg : expr
This commit is contained in:
parent
f82d4845f2
commit
7ffec7028a
11 changed files with 32 additions and 28 deletions
|
@ -136,11 +136,11 @@ pub fn print_crate<'a>(
|
|||
s.s.eof()
|
||||
}
|
||||
|
||||
// This makes printed token streams look slightly nicer,
|
||||
// and also addresses some specific regressions described in #63896 and #73345.
|
||||
/// This makes printed token streams look slightly nicer,
|
||||
/// and also addresses some specific regressions described in #63896 and #73345.
|
||||
fn tt_prepend_space(tt: &TokenTree, prev: &TokenTree) -> bool {
|
||||
if let TokenTree::Token(token) = prev {
|
||||
if matches!(token.kind, token::Dot) {
|
||||
if matches!(token.kind, token::Dot | token::Dollar) {
|
||||
return false;
|
||||
}
|
||||
if let token::DocComment(comment_kind, ..) = token.kind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue