diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-30 16:01:07 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-30 18:38:15 -0700 |
| commit | a9cc5066ee61f20e7cc59141d5c7213a452a2778 (patch) | |
| tree | e65d0e9b5a3d3abf723d596a32785b5655505af1 /src/libsyntax/ext/fmt.rs | |
| parent | 650fb06d68771828406f4f27e3af5db9c11311c5 (diff) | |
Change syntax extension syntax: `#m[...]` -> `m!{...}`.
Diffstat (limited to 'src/libsyntax/ext/fmt.rs')
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 53b5db8b6a6..d8549ca21c8 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -18,7 +18,7 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: ast::mac_arg, expr_to_str(cx, args[0], ~"first argument to #fmt must be a string literal."); let fmtspan = args[0].span; - #debug("Format string:"); + debug!{"Format string:"}; log(debug, fmt); fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: ~str) -> ! { cx.span_fatal(sp, msg); @@ -189,15 +189,15 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, fn log_conv(c: conv) { alt c.param { some(p) { log(debug, ~"param: " + int::to_str(p, 10u)); } - _ { #debug("param: none"); } + _ { debug!{"param: none"}; } } for c.flags.each |f| { alt f { - flag_left_justify { #debug("flag: left justify"); } - flag_left_zero_pad { #debug("flag: left zero pad"); } - flag_space_for_sign { #debug("flag: left space pad"); } - flag_sign_always { #debug("flag: sign always"); } - flag_alternate { #debug("flag: alternate"); } + flag_left_justify { debug!{"flag: left justify"}; } + flag_left_zero_pad { debug!{"flag: left zero pad"}; } + flag_space_for_sign { debug!{"flag: left space pad"}; } + flag_sign_always { debug!{"flag: sign always"}; } + flag_alternate { debug!{"flag: alternate"}; } } } alt c.width { @@ -207,8 +207,8 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, log(debug, ~"width: count is param " + int::to_str(i, 10u)); } - count_is_next_param { #debug("width: count is next param"); } - count_implied { #debug("width: count is implied"); } + count_is_next_param { debug!{"width: count is next param"}; } + count_implied { debug!{"width: count is implied"}; } } alt c.precision { count_is(i) { log(debug, @@ -217,29 +217,29 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, log(debug, ~"prec: count is param " + int::to_str(i, 10u)); } - count_is_next_param { #debug("prec: count is next param"); } - count_implied { #debug("prec: count is implied"); } + count_is_next_param { debug!{"prec: count is next param"}; } + count_implied { debug!{"prec: count is implied"}; } } alt c.ty { - ty_bool { #debug("type: bool"); } - ty_str { #debug("type: str"); } - ty_char { #debug("type: char"); } + ty_bool { debug!{"type: bool"}; } + ty_str { debug!{"type: str"}; } + ty_char { debug!{"type: char"}; } ty_int(s) { alt s { - signed { #debug("type: signed"); } - unsigned { #debug("type: unsigned"); } + signed { debug!{"type: signed"}; } + unsigned { debug!{"type: unsigned"}; } } } - ty_bits { #debug("type: bits"); } + ty_bits { debug!{"type: bits"}; } ty_hex(cs) { alt cs { - case_upper { #debug("type: uhex"); } - case_lower { #debug("type: lhex"); } + case_upper { debug!{"type: uhex"}; } + case_lower { debug!{"type: lhex"}; } } } - ty_octal { #debug("type: octal"); } - ty_float { #debug("type: float"); } - ty_poly { #debug("type: poly"); } + ty_octal { debug!{"type: octal"}; } + ty_float { debug!{"type: float"}; } + ty_poly { debug!{"type: poly"}; } } } let fmt_sp = args[0].span; @@ -258,7 +258,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, ~"not enough arguments to #fmt " + ~"for the given format string"); } - #debug("Building conversion:"); + debug!{"Building conversion:"}; log_conv(conv); let arg_expr = args[n]; let c_expr = make_new_conv(cx, fmt_sp, conv, arg_expr); @@ -270,8 +270,8 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, if expected_nargs < nargs { cx.span_fatal - (sp, #fmt["too many arguments to #fmt. found %u, expected %u", - nargs, expected_nargs]); + (sp, fmt!{"too many arguments to #fmt. found %u, expected %u", + nargs, expected_nargs}); } let arg_vec = mk_fixed_vec_e(cx, fmt_sp, piece_exprs); |
