diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-04-16 04:12:02 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-04-24 20:59:44 +0300 |
| commit | 546c052d225d41cd31f610e87a20f15cd0fa8e3c (patch) | |
| tree | d2d1bb3b10895f266c2d5137c7aba8f8515583af /src/libsyntax/print/pprust.rs | |
| parent | 8dbf8f5f0a26a8f80f895294532ad567c156beb3 (diff) | |
| download | rust-546c052d225d41cd31f610e87a20f15cd0fa8e3c.tar.gz rust-546c052d225d41cd31f610e87a20f15cd0fa8e3c.zip | |
syntax: Get rid of token::IdentStyle
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 95f1b63168b..4fe076b3a7b 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -270,14 +270,14 @@ pub fn token_to_string(tok: &Token) -> String { } /* Name components */ - token::Ident(s, _) => s.to_string(), + token::Ident(s) => s.to_string(), token::Lifetime(s) => s.to_string(), token::Underscore => "_".to_string(), /* Other */ token::DocComment(s) => s.to_string(), - token::SubstNt(s, _) => format!("${}", s), - token::MatchNt(s, t, _, _) => format!("${}:{}", s, t), + token::SubstNt(s) => format!("${}", s), + token::MatchNt(s, t) => format!("${}:{}", s, t), token::Eof => "<eof>".to_string(), token::Whitespace => " ".to_string(), token::Comment => "/* */".to_string(), @@ -294,7 +294,7 @@ pub fn token_to_string(tok: &Token) -> String { token::NtBlock(ref e) => block_to_string(&e), token::NtStmt(ref e) => stmt_to_string(&e), token::NtPat(ref e) => pat_to_string(&e), - token::NtIdent(ref e, _) => ident_to_string(e.node), + token::NtIdent(ref e) => ident_to_string(e.node), token::NtTT(ref e) => tt_to_string(&e), token::NtArm(ref e) => arm_to_string(&e), token::NtImplItem(ref e) => impl_item_to_string(&e), @@ -1488,20 +1488,11 @@ impl<'a> State<'a> { pub fn print_tts(&mut self, tts: &[ast::TokenTree]) -> io::Result<()> { self.ibox(0)?; - let mut suppress_space = false; for (i, tt) in tts.iter().enumerate() { - if i != 0 && !suppress_space { + if i != 0 { space(&mut self.s)?; } self.print_tt(tt)?; - // There should be no space between the module name and the following `::` in paths, - // otherwise imported macros get re-parsed from crate metadata incorrectly (#20701) - suppress_space = match *tt { - TokenTree::Token(_, token::Ident(_, token::ModName)) | - TokenTree::Token(_, token::MatchNt(_, _, _, token::ModName)) | - TokenTree::Token(_, token::SubstNt(_, token::ModName)) => true, - _ => false - } } self.end() } |
