]> git.lizzy.rs Git - rust.git/commitdiff
Pretty-print macros with `()` instead of `{}`.
authorPaul Stansifer <paul.stansifer@gmail.com>
Thu, 23 Aug 2012 02:08:21 +0000 (19:08 -0700)
committerPaul Stansifer <paul.stansifer@gmail.com>
Thu, 23 Aug 2012 18:14:15 +0000 (11:14 -0700)
src/libsyntax/print/pprust.rs

index 8320d438b4e631557c7ae6a36ad430260c1ac367..bcd221633420d15185dcd33ed545e22fd500ff68 100644 (file)
@@ -527,11 +527,13 @@ fn print_item(s: ps, &&item: @ast::item) {
       }
       ast::item_mac({node: ast::mac_invoc_tt(pth, tts), _}) => {
         print_path(s, pth, false);
-        head(s, ~"! ");
+        word(s.s, ~"! ");
         print_ident(s, item.ident);
-        bopen(s);
+        cbox(s, indent_unit);
+        popen(s);
         for tts.each |tt| { print_tt(s, tt);  }
-        bclose(s, item.span);
+        pclose(s);
+        end(s);
       }
       ast::item_mac(_) => {
         fail ~"invalid item-position syntax bit"
@@ -931,10 +933,10 @@ fn print_mac(s: ps, m: ast::mac) {
       }
       ast::mac_invoc_tt(pth, tts) => {
         print_path(s, pth, false);
-        head(s, ~"!");
-        bopen(s);
+        word(s.s, ~"!");
+        popen(s);
         for tts.each() |tt| { print_tt(s, tt); }
-        bclose(s, m.span);
+        pclose(s);
       }
       ast::mac_ellipsis => word(s.s, ~"..."),
       ast::mac_var(v) => word(s.s, fmt!("$%u", v)),