From da74a7f9ca774cd8addcb00a361bb230facc3b31 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Wed, 1 Feb 2012 00:20:31 -0700 Subject: Make macro arg optional in syntax, again untested. --- src/comp/syntax/print/pprust.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/comp/syntax/print') diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 74ebd271b6a..59ea8216c43 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -726,8 +726,11 @@ fn print_mac(s: ps, m: ast::mac) { ast::mac_invoc(path, arg, body) { word(s.s, "#"); print_path(s, path, false); - alt arg.node { ast::expr_vec(_, _) { } _ { word(s.s, " "); } } - print_expr(s, arg); + alt arg { + some(@{node: ast::expr_vec(_, _), _}) { } + _ { word(s.s, " "); } + } + option::may(arg, bind print_expr(s, _)); // FIXME: extension 'body' } ast::mac_embed_type(ty) { -- cgit 1.4.1-3-g733a5