diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-03-05 05:15:58 +0000 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-03-10 08:08:32 -0800 |
| commit | 212b6c25507b963b60a646a2ff3df7496bd30acf (patch) | |
| tree | 8fd7c3e2317c5b9c92e17aaec9b4c48a72f75ac7 /src/libsyntax/print | |
| parent | f573db4f80c75f156df8a743f456bf087ec81dc2 (diff) | |
| download | rust-212b6c25507b963b60a646a2ff3df7496bd30acf.tar.gz rust-212b6c25507b963b60a646a2ff3df7496bd30acf.zip | |
Refactor out `ast::ItemKind::MacroDef`.
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 53ef8e8dfa4..78212fb4b44 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1318,7 +1318,6 @@ impl<'a> State<'a> { self.bclose(item.span)?; } ast::ItemKind::Mac(codemap::Spanned { ref node, .. }) => { - self.print_visibility(&item.vis)?; self.print_path(&node.path, false, 0, false)?; word(&mut self.s, "! ")?; self.print_ident(item.ident)?; @@ -1329,6 +1328,16 @@ impl<'a> State<'a> { word(&mut self.s, ";")?; self.end()?; } + ast::ItemKind::MacroDef(ref tts, _) => { + word(&mut self.s, "macro_rules! ")?; + self.print_ident(item.ident)?; + self.cbox(INDENT_UNIT)?; + self.popen()?; + self.print_tts(tts.clone().into())?; + self.pclose()?; + word(&mut self.s, ";")?; + self.end()?; + } } self.ann.post(self, NodeItem(item)) } |
