diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-08-22 17:24:52 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-08-23 11:14:14 -0700 |
| commit | 29f32b4a7298b0807408658bc8add1de8a06ab12 (patch) | |
| tree | c989293754f94ce2c22cee3902af0c57d33e6dd0 /src/libsyntax | |
| parent | 226fd87199fb0184fb39ffc5dff3865cfdc9f362 (diff) | |
| download | rust-29f32b4a7298b0807408658bc8add1de8a06ab12.tar.gz rust-29f32b4a7298b0807408658bc8add1de8a06ab12.zip | |
`m1!{...}` -> `m1!(...)`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_map.rs | 40 | ||||
| -rw-r--r-- | src/libsyntax/attr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_serialize.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 22 | ||||
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 50 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/check.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/liveness.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 38 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/qquote.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/simplext.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/earley_parser.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 20 | ||||
| -rw-r--r-- | src/libsyntax/parse/common.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/eval.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 46 | ||||
| -rw-r--r-- | src/libsyntax/print/pp.rs | 74 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 4 |
24 files changed, 219 insertions, 219 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 9c90a422c53..fbcfb3139d1 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -25,7 +25,7 @@ fn path_ident_to_str(p: path, i: ident, itr: ident_interner) -> ~str { //FIXME /* FIXME (#2543) */ copy *i *itr.get(i) } else { - fmt!{"%s::%s", path_to_str(p, itr), *itr.get(i)} + fmt!("%s::%s", path_to_str(p, itr), *itr.get(i)) } } @@ -296,7 +296,7 @@ fn map_stmt(stmt: @stmt, cx: ctx, v: vt) { fn node_id_to_str(map: map, id: node_id, itr: ident_interner) -> ~str { match map.find(id) { none => { - fmt!{"unknown node (id=%d)", id} + fmt!("unknown node (id=%d)", id) } some(node_item(item, path)) => { let path_str = path_ident_to_str(*path, item.ident, itr); @@ -315,48 +315,48 @@ fn node_id_to_str(map: map, id: node_id, itr: ident_interner) -> ~str { fmt!("%s %s (id=%?)", item_str, path_str, id) } some(node_foreign_item(item, abi, path)) => { - fmt!{"foreign item %s with abi %? (id=%?)", - path_ident_to_str(*path, item.ident, itr), abi, id} + fmt!("foreign item %s with abi %? (id=%?)", + path_ident_to_str(*path, item.ident, itr), abi, id) } some(node_method(m, impl_did, path)) => { - fmt!{"method %s in %s (id=%?)", - *itr.get(m.ident), path_to_str(*path, itr), id} + fmt!("method %s in %s (id=%?)", + *itr.get(m.ident), path_to_str(*path, itr), id) } some(node_trait_method(tm, impl_did, path)) => { let m = ast_util::trait_method_to_ty_method(*tm); - fmt!{"method %s in %s (id=%?)", - *itr.get(m.ident), path_to_str(*path, itr), id} + fmt!("method %s in %s (id=%?)", + *itr.get(m.ident), path_to_str(*path, itr), id) } some(node_variant(variant, def_id, path)) => { - fmt!{"variant %s in %s (id=%?)", - *itr.get(variant.node.name), path_to_str(*path, itr), id} + fmt!("variant %s in %s (id=%?)", + *itr.get(variant.node.name), path_to_str(*path, itr), id) } some(node_expr(expr)) => { - fmt!{"expr %s (id=%?)", pprust::expr_to_str(expr, itr), id} + fmt!("expr %s (id=%?)", pprust::expr_to_str(expr, itr), id) } some(node_stmt(stmt)) => { - fmt!{"stmt %s (id=%?)", - pprust::stmt_to_str(*stmt, itr), id} + fmt!("stmt %s (id=%?)", + pprust::stmt_to_str(*stmt, itr), id) } // FIXMEs are as per #2410 some(node_export(_, path)) => { - fmt!{"export %s (id=%?)", // add more info here - path_to_str(*path, itr), id} + fmt!("export %s (id=%?)", // add more info here + path_to_str(*path, itr), id) } some(node_arg(_, _)) => { // add more info here - fmt!{"arg (id=%?)", id} + fmt!("arg (id=%?)", id) } some(node_local(_)) => { // add more info here - fmt!{"local (id=%?)", id} + fmt!("local (id=%?)", id) } some(node_ctor(*)) => { // add more info here - fmt!{"node_ctor (id=%?)", id} + fmt!("node_ctor (id=%?)", id) } some(node_dtor(*)) => { // add more info here - fmt!{"node_dtor (id=%?)", id} + fmt!("node_dtor (id=%?)", id) } some(node_block(_)) => { - fmt!{"block"} + fmt!("block") } } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index c339d322af8..c1838c77802 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -368,7 +368,7 @@ fn require_unique_names(diagnostic: span_handler, // FIXME: How do I silence the warnings? --pcw (#2619) if map.contains_key(name) { diagnostic.span_fatal(meta.span, - fmt!{"duplicate meta item `%s`", name}); + fmt!("duplicate meta item `%s`", name)); } map.insert(name, ()); } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index e0e93b1eda5..bbaaf2deb35 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -73,7 +73,7 @@ fn new_filemap(+filename: filename, src: @~str, fn mk_substr_filename(cm: codemap, sp: span) -> ~str { let pos = lookup_char_pos(cm, sp.lo); - return fmt!{"<%s:%u:%u>", pos.file.name, pos.line, pos.col}; + return fmt!("<%s:%u:%u>", pos.file.name, pos.line, pos.col); } fn next_line(file: filemap, chpos: uint, byte_pos: uint) { @@ -93,7 +93,7 @@ fn lookup_line(map: codemap, pos: uint, lookup: lookup_fn) if lookup(map.files[m].start_pos) > pos { b = m; } else { a = m; } } if (a >= len) { - fail fmt!{"position %u does not resolve to a source location", pos} + fail fmt!("position %u does not resolve to a source location", pos) } let f = map.files[a]; a = 0u; @@ -166,15 +166,15 @@ type span = {lo: uint, hi: uint, expn_info: expn_info}; fn span_to_str_no_adj(sp: span, cm: codemap) -> ~str { let lo = lookup_char_pos(cm, sp.lo); let hi = lookup_char_pos(cm, sp.hi); - return fmt!{"%s:%u:%u: %u:%u", lo.file.name, - lo.line, lo.col, hi.line, hi.col} + return fmt!("%s:%u:%u: %u:%u", lo.file.name, + lo.line, lo.col, hi.line, hi.col) } fn span_to_str(sp: span, cm: codemap) -> ~str { let lo = lookup_char_pos_adj(cm, sp.lo); let hi = lookup_char_pos_adj(cm, sp.hi); - return fmt!{"%s:%u:%u: %u:%u", lo.filename, - lo.line, lo.col, hi.line, hi.col} + return fmt!("%s:%u:%u: %u:%u", lo.filename, + lo.line, lo.col, hi.line, hi.col) } type file_lines = {file: filemap, lines: ~[uint]}; diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 38c8131147c..0c622cf7a7c 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -91,8 +91,8 @@ impl handler_t: handler { 0u => return, 1u => s = ~"aborting due to previous error", _ => { - s = fmt!{"aborting due to %u previous errors", - self.err_count}; + s = fmt!("aborting due to %u previous errors", + self.err_count); } } self.fatal(s); @@ -113,7 +113,7 @@ impl handler_t: handler { } fn ice_msg(msg: ~str) -> ~str { - fmt!{"internal compiler error: %s", msg} + fmt!("internal compiler error: %s", msg) } fn mk_span_handler(handler: handler, cm: codemap::codemap) -> span_handler { @@ -168,16 +168,16 @@ fn print_diagnostic(topic: ~str, lvl: level, msg: ~str) { let use_color = term::color_supported() && io::stderr().get_type() == io::Screen; if str::is_not_empty(topic) { - io::stderr().write_str(fmt!{"%s ", topic}); + io::stderr().write_str(fmt!("%s ", topic)); } if use_color { term::fg(io::stderr(), diagnosticcolor(lvl)); } - io::stderr().write_str(fmt!{"%s:", diagnosticstr(lvl)}); + io::stderr().write_str(fmt!("%s:", diagnosticstr(lvl))); if use_color { term::reset(io::stderr()); } - io::stderr().write_str(fmt!{" %s\n", msg}); + io::stderr().write_str(fmt!(" %s\n", msg)); } fn emit(cmsp: option<(codemap::codemap, span)>, @@ -212,13 +212,13 @@ fn highlight_lines(cm: codemap::codemap, sp: span, } // Print the offending lines for display_lines.each |line| { - io::stderr().write_str(fmt!{"%s:%u ", fm.name, line + 1u}); + io::stderr().write_str(fmt!("%s:%u ", fm.name, line + 1u)); let s = codemap::get_line(fm, line as int) + ~"\n"; io::stderr().write_str(s); } if elided { let last_line = display_lines[vec::len(display_lines) - 1u]; - let s = fmt!{"%s:%u ", fm.name, last_line + 1u}; + let s = fmt!("%s:%u ", fm.name, last_line + 1u); let mut indent = str::len(s); let mut out = ~""; while indent > 0u { out += ~" "; indent -= 1u; } @@ -257,7 +257,7 @@ fn print_macro_backtrace(cm: codemap::codemap, sp: span) { let ss = option::map_default(ei.callie.span, @~"", |span| @codemap::span_to_str(span, cm)); print_diagnostic(*ss, note, - fmt!{"in expansion of #%s", ei.callie.name}); + fmt!("in expansion of #%s", ei.callie.name)); let ss = codemap::span_to_str(ei.call_site, cm); print_diagnostic(ss, note, ~"expansion site"); print_macro_backtrace(cm, ei.call_site); diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index e5b65b41fc8..d094bfe6f01 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -356,7 +356,7 @@ fn ser_variant(cx: ext_ctxt, argfn: fn(-@ast::expr, uint, ast::blk) -> @ast::expr) -> ast::arm { let vnames = do vec::from_fn(vec::len(tys)) |i| { - cx.parse_sess().interner.intern(@fmt!{"__v%u", i}) + cx.parse_sess().interner.intern(@fmt!("__v%u", i)) }; let pats = do vec::from_fn(vec::len(tys)) |i| { cx.binder_pat(tys[i].span, vnames[i]) @@ -406,7 +406,7 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map, ast::ty_bot => { cx.span_err( - ty.span, fmt!{"Cannot serialize bottom type"}); + ty.span, fmt!("Cannot serialize bottom type")); ~[] } @@ -553,7 +553,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident, ident: cx.ident_of(~"__s" + cx.str_of(tp.ident)), id: cx.next_id()}); - debug!{"tp_inputs = %?", tp_inputs}; + debug!("tp_inputs = %?", tp_inputs); let ser_inputs: ~[ast::arg] = @@ -574,7 +574,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident, tp.ident, fn@(v: @ast::expr) -> ~[@ast::stmt] { let f = cx.var_ref(span, arg_ident); - debug!{"serializing type arg %s", cx.str_of(arg_ident)}; + debug!("serializing type arg %s", cx.str_of(arg_ident)); ~[#ast[stmt]{$(f)($(v));}] }); } @@ -765,7 +765,7 @@ fn mk_deser_fn(cx: ext_ctxt, span: span, ident: cx.ident_of(~"__d" + cx.str_of(tp.ident)), id: cx.next_id()}); - debug!{"tp_inputs = %?", tp_inputs}; + debug!("tp_inputs = %?", tp_inputs); let deser_inputs: ~[ast::arg] = vec::append(~[{mode: ast::expl(ast::by_ref), diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index bb8a845d731..b16a8f11427 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -267,21 +267,21 @@ fn get_mac_args(cx: ext_ctxt, sp: span, arg: ast::mac_arg, match max { some(max) if ! (min <= elts_len && elts_len <= max) => { cx.span_fatal(sp, - fmt!{"#%s takes between %u and %u arguments.", - name, min, max}); + fmt!("#%s takes between %u and %u arguments.", + name, min, max)); } none if ! (min <= elts_len) => { - cx.span_fatal(sp, fmt!{"#%s needs at least %u arguments.", - name, min}); + cx.span_fatal(sp, fmt!("#%s needs at least %u arguments.", + name, min)); } _ => return elts /* we are good */ } } _ => { - cx.span_fatal(sp, fmt!{"#%s: malformed invocation", name}) + cx.span_fatal(sp, fmt!("#%s: malformed invocation", name)) } }, - none => cx.span_fatal(sp, fmt!{"#%s: missing arguments", name}) + none => cx.span_fatal(sp, fmt!("#%s: missing arguments", name)) } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index fb083744321..0b6c2ea5a99 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -31,12 +31,12 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, match exts.find(*extname) { none => { cx.span_fatal(pth.span, - fmt!{"macro undefined: '%s'", *extname}) + fmt!("macro undefined: '%s'", *extname)) } some(item_decorator(_)) => { cx.span_fatal( pth.span, - fmt!{"%s can only be used as a decorator", *extname}); + fmt!("%s can only be used as a decorator", *extname)); } some(normal({expander: exp, span: exp_sp})) => { let expanded = exp(cx, mac.span, args, body); @@ -56,8 +56,8 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, } some(expr_tt(_)) => { cx.span_fatal(pth.span, - fmt!{"this tt-style macro should be \ - invoked '%s!{...}'", *extname}) + fmt!("this tt-style macro should be \ + invoked '%s!(...)'", *extname)) } some(item_tt(*)) => { cx.span_fatal(pth.span, @@ -76,14 +76,14 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, match exts.find(*extname) { none => { cx.span_fatal(pth.span, - fmt!{"macro undefined: '%s'", *extname}) + fmt!("macro undefined: '%s'", *extname)) } some(expr_tt({expander: exp, span: exp_sp})) => { let expanded = match exp(cx, mac.span, tts) { mr_expr(e) => e, _ => cx.span_fatal( - pth.span, fmt!{"non-expr macro in expr pos: %s", - *extname}) + pth.span, fmt!("non-expr macro in expr pos: %s", + *extname)) }; cx.bt_push(expanded_from({call_site: s, @@ -110,8 +110,8 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, } _ => { cx.span_fatal(pth.span, - fmt!{"'%s' is not a tt-style macro", - *extname}) + fmt!("'%s' is not a tt-style macro", + *extname)) } } @@ -202,7 +202,7 @@ fn expand_item_mac(exts: hashmap<~str, syntax_extension>, match exts.find(*extname) { none => { cx.span_fatal(pth.span, - fmt!{"macro undefined: '%s'", *extname}) + fmt!("macro undefined: '%s'", *extname)) } some(item_tt(expand)) => { let expanded = expand.expander(cx, it.span, it.ident, tts); @@ -223,7 +223,7 @@ fn expand_item_mac(exts: hashmap<~str, syntax_extension>, return maybe_it } _ => cx.span_fatal(it.span, - fmt!{"%s is not a legal here", *extname}) + fmt!("%s is not a legal here", *extname)) } } _ => cx.span_bug(it.span, ~"invalid item macro invocation") diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 9392ea5ad3c..6e459a551fe 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); @@ -193,15 +193,15 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, fn log_conv(c: conv) { match c.param { some(p) => { log(debug, ~"param: " + int::to_str(p, 10u)); } - _ => debug!{"param: none"} + _ => debug!("param: none") } for c.flags.each |f| { match 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") } } match c.width { @@ -209,33 +209,33 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, debug, ~"width: count is " + int::to_str(i, 10u)), count_is_param(i) => 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") } match c.precision { count_is(i) => log( debug, ~"prec: count is " + int::to_str(i, 10u)), count_is_param(i) => 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") } match 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) => match 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) => match 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; @@ -254,7 +254,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); @@ -266,8 +266,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); diff --git a/src/libsyntax/ext/pipes/check.rs b/src/libsyntax/ext/pipes/check.rs index b7ad5c21bd9..60d1d666a7f 100644 --- a/src/libsyntax/ext/pipes/check.rs +++ b/src/libsyntax/ext/pipes/check.rs @@ -32,9 +32,9 @@ impl ext_ctxt: proto::visitor<(), (), ()> { if state.messages.len() == 0 { self.span_warn( state.span, // use a real span! - fmt!{"state %s contains no messages, \ + fmt!("state %s contains no messages, \ consider stepping to a terminal state instead", - state.name}) + state.name)) } } @@ -48,8 +48,8 @@ impl ext_ctxt: proto::visitor<(), (), ()> { // track span information. self.span_err( proto.get_state(next).span, - fmt!{"message %s steps to undefined state, %s", - name, next}); + fmt!("message %s steps to undefined state, %s", + name, next)); } else { let next = proto.get_state(next); @@ -57,11 +57,11 @@ impl ext_ctxt: proto::visitor<(), (), ()> { if next.ty_params.len() != next_tys.len() { self.span_err( next.span, // use a real span - fmt!{"message %s target (%s) \ + fmt!("message %s target (%s) \ needs %u type parameters, but got %u", name, next.name, next.ty_params.len(), - next_tys.len()}); + next_tys.len())); } } } diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index 2325e4ed27d..a3dfdb6a769 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -32,7 +32,7 @@ import std::bitv::{bitv}; import ast_builder::empty_span; fn analyze(proto: protocol, _cx: ext_ctxt) { - debug!{"initializing colive analysis"}; + debug!("initializing colive analysis"); let num_states = proto.num_states(); let colive = do (copy proto.states).map_to_vec |state| { let bv = ~bitv(num_states, false); @@ -46,7 +46,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) { let mut changed = true; while changed { changed = false; - debug!{"colive iteration %?", i}; + debug!("colive iteration %?", i); for colive.eachi |i, this_colive| { let this = proto.get_state_by_id(i); for this_colive.ones |j| { @@ -59,7 +59,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) { i += 1; } - debug!{"colive analysis complete"}; + debug!("colive analysis complete"); // Determine if we're bounded let mut self_live = ~[]; @@ -72,20 +72,20 @@ fn analyze(proto: protocol, _cx: ext_ctxt) { if self_live.len() > 0 { let states = str::connect(self_live.map(|s| s.name), ~" "); - debug!{"protocol %s is unbounded due to loops involving: %s", - proto.name, states}; + debug!("protocol %s is unbounded due to loops involving: %s", + proto.name, states); // Someday this will be configurable with a warning //cx.span_warn(empty_span(), - // fmt!{"protocol %s is unbounded due to loops \ + // fmt!("protocol %s is unbounded due to loops \ // involving these states: %s", // *proto.name, - // states}); + // states)); proto.bounded = some(false); } else { - debug!{"protocol %s is bounded. yay!", proto.name}; + debug!("protocol %s is bounded. yay!", proto.name); proto.bounded = some(true); } } \ No newline at end of file diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index b5a1ae588a7..315d02eadd3 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -39,7 +39,7 @@ trait gen_init { impl message: gen_send { fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item { - debug!{"pipec: gen_send"}; + debug!("pipec: gen_send"); match self { message(id, span, tys, this, some({state: next, tys: next_tys})) => { @@ -75,9 +75,9 @@ impl message: gen_send { body += fmt!("let %s = pipes::send_packet_buffered(\ ptr::addr_of(b.buffer.data.%s));\n", sp, next.name); - body += fmt!{"let %s = pipes::recv_packet_buffered(\ + body += fmt!("let %s = pipes::recv_packet_buffered(\ ptr::addr_of(b.buffer.data.%s));\n", - rp, next.name}; + rp, next.name); } else { let pat = match (this.dir, next.dir) { @@ -97,7 +97,7 @@ impl message: gen_send { ~", ")); if !try { - body += fmt!{"pipes::send(pipe, message);\n"}; + body += fmt!("pipes::send(pipe, message);\n"); // return the new channel body += ~"c }"; } @@ -127,7 +127,7 @@ impl message: gen_send { } message(id, span, tys, this, none) => { - debug!{"pipec: no next state"}; + debug!("pipec: no next state"); let arg_names = tys.mapi(|i, _ty| (~"x_" + i.to_str())); let args_ast = (arg_names, tys).map( @@ -150,13 +150,13 @@ impl message: gen_send { }; let mut body = ~"{ "; - body += fmt!{"let message = %s::%s%s;\n", + body += fmt!("let message = %s::%s%s;\n", this.proto.name, self.name(), - message_args}; + message_args); if !try { - body += fmt!{"pipes::send(pipe, message);\n"}; + body += fmt!("pipes::send(pipe, message);\n"); body += ~" }"; } else { body += fmt!("if pipes::send(pipe, message) { \ @@ -192,7 +192,7 @@ impl message: gen_send { impl state: to_type_decls { fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item] { - debug!{"pipec: to_type_decls"}; + debug!("pipec: to_type_decls"); // This compiles into two different type declarations. Say the // state is called ping. This will generate both `ping` and // `ping_message`. The first contains data that the user cares @@ -238,7 +238,7 @@ impl state: to_type_decls { } fn to_endpoint_decls(cx: ext_ctxt, dir: direction) -> ~[@ast::item] { - debug!{"pipec: to_endpoint_decls"}; + debug!("pipec: to_endpoint_decls"); let dir = match dir { send => (*self).dir, recv => (*self).dir.reverse() @@ -293,7 +293,7 @@ impl protocol: gen_init { fn gen_init(cx: ext_ctxt) -> @ast::item { let ext_cx = cx; - debug!{"gen_init"}; + debug!("gen_init"); let start_state = self.states[0]; let body = if !self.is_bounded() { @@ -320,12 +320,12 @@ impl protocol: gen_init { } }; - cx.parse_item(fmt!{"fn init%s() -> (client::%s, server::%s)\ + cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\ { import pipes::has_buffer; %s }", start_state.ty_params.to_source(cx), start_state.to_ty(cx).to_source(cx), start_state.to_ty(cx).to_source(cx), - body.to_source(cx)}) + body.to_source(cx))) } fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr { @@ -337,7 +337,7 @@ impl protocol: gen_init { } fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr { - debug!{"gen_init_bounded"}; + debug!("gen_init_bounded"); let buffer_fields = self.gen_buffer_init(ext_cx); let buffer = #ast { @@ -349,11 +349,11 @@ impl protocol: gen_init { ext_cx.block( self.states.map_to_vec( |s| ext_cx.parse_stmt( - fmt!{"data.%s.set_buffer(buffer)", - s.name})), + fmt!("data.%s.set_buffer(buffer)", + s.name))), ext_cx.parse_expr( - fmt!{"ptr::addr_of(data.%s)", - self.states[0].name}))); + fmt!("ptr::addr_of(data.%s)", + self.states[0].name)))); #ast {{ let buffer = $(buffer); @@ -490,7 +490,7 @@ impl ext_ctxt: ext_ctxt_parse_utils { match res { some(ast) => ast, none => { - error!{"Parse error with ```\n%s\n```", s}; + error!("Parse error with ```\n%s\n```", s); fail } } diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 62c5329525f..eea4e434956 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -152,9 +152,9 @@ struct protocol_ { let bounded = self.bounded.get(); bounded //if bounded && self.has_ty_params() { - // debug!{"protocol %s has is bounded, but type parameters\ + // debug!("protocol %s has is bounded, but type parameters\ // are not yet supported.", - // *self.name}; + // *self.name); // false //} //else { bounded } diff --git a/src/libsyntax/ext/qquote.rs b/src/libsyntax/ext/qquote.rs index 8024f5f9542..de4d1975e24 100644 --- a/src/libsyntax/ext/qquote.rs +++ b/src/libsyntax/ext/qquote.rs @@ -205,7 +205,7 @@ fn finish<T: qq_helper> { let cm = ecx.codemap(); let str = @codemap::span_to_snippet(body.span, cm); - debug!{"qquote--str==%?", str}; + debug!("qquote--str==%?", str); let fname = codemap::mk_substr_filename(cm, body.span); let node = parse_from_source_str (f, fname, codemap::fss_internal(body.span), str, @@ -231,7 +231,7 @@ fn finish<T: qq_helper> do str::chars_iter(*str) |ch| { if (j < g_len && i == cx.gather[j].lo) { assert ch == '$'; - let repl = fmt!{"$%u ", j}; + let repl = fmt!("$%u ", j); state = skip(str::char_len(repl)); str2 += repl; } diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs index 5b9bac1948f..7c37312a433 100644 --- a/src/libsyntax/ext/simplext.rs +++ b/src/libsyntax/ext/simplext.rs @@ -255,9 +255,9 @@ fn free_vars(b: bindings, e: @expr, it: fn(ident)) { fn wrong_occurs(cx: ext_ctxt, l: ident, l_c: uint, r: ident, r_c: uint) -> ~str { - fmt!{"'%s' occurs %u times, but '%s' occurs %u times", + fmt!("'%s' occurs %u times, but '%s' occurs %u times", *cx.parse_sess().interner.get(l), l_c, - *cx.parse_sess().interner.get(r), r_c} + *cx.parse_sess().interner.get(r), r_c) } /* handle sequences (anywhere in the AST) of exprs, either real or ...ed */ diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index c323f201b83..b74a1165b79 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -13,7 +13,7 @@ export expand_include; export expand_include_str; export expand_include_bin; -/* line!{}: expands to the current line number */ +/* line!(): expands to the current line number */ fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { get_mac_args(cx, sp, arg, 0u, option::some(0u), ~"line"); @@ -21,7 +21,7 @@ fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg, return mk_uint(cx, sp, loc.line); } -/* col!{}: expands to the current column number */ +/* col!(): expands to the current column number */ fn expand_col(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { get_mac_args(cx, sp, arg, 0u, option::some(0u), ~"col"); @@ -29,7 +29,7 @@ fn expand_col(cx: ext_ctxt, sp: span, arg: ast::mac_arg, return mk_uint(cx, sp, loc.col); } -/* file!{}: expands to the current filename */ +/* file!(): expands to the current filename */ /* The filemap (`loc.file`) contains a bunch more information we could spit * out if we wanted. */ fn expand_file(cx: ext_ctxt, sp: span, arg: ast::mac_arg, diff --git a/src/libsyntax/ext/tt/earley_parser.rs b/src/libsyntax/ext/tt/earley_parser.rs index 896b6f6e54f..c9a6928a72d 100644 --- a/src/libsyntax/ext/tt/earley_parser.rs +++ b/src/libsyntax/ext/tt/earley_parser.rs @@ -274,15 +274,15 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) let nts = str::connect(vec::map(bb_eis, |ei| { match ei.elts[ei.idx].node { match_nonterminal(bind,name,_) => { - fmt!{"%s ('%s')", *sess.interner.get(name), - *sess.interner.get(bind)} + fmt!("%s ('%s')", *sess.interner.get(name), + *sess.interner.get(bind)) } _ => fail } }), ~" or "); - return error(sp, fmt!{ + return error(sp, fmt!( "Local ambiguity: multiple parsing options: \ built-in NTs %s or %u other options.", - nts, next_eis.len()}); + nts, next_eis.len())); } else if (bb_eis.len() == 0u && next_eis.len() == 0u) { return failure(sp, ~"No rules expected the token " + to_str(rdr.interner(), tok)); diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 1653c57bf2c..981e483f13d 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -112,9 +112,9 @@ fn lockstep_iter_size(t: token_tree, r: tt_reader) -> lis { lis_constraint(r_len, r_id) => { let l_n = *r.interner.get(l_id); let r_n = *r.interner.get(r_id); - lis_contradiction(fmt!{"Inconsistent lockstep iteration: \ + lis_contradiction(fmt!("Inconsistent lockstep iteration: \ '%s' has %u items, but '%s' has %u", - l_n, l_len, r_n, r_len}) + l_n, l_len, r_n, r_len)) } } } @@ -231,8 +231,8 @@ fn tt_next_token(&&r: tt_reader) -> {tok: token, sp: span} { matched_seq(*) => { r.sp_diag.span_fatal( copy r.cur_span, /* blame the macro writer */ - fmt!{"variable '%s' is still repeating at this depth", - *r.interner.get(ident)}); + fmt!("variable '%s' is still repeating at this depth", + *r.interner.get(ident))); } } } diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 09edbda4335..b80e472c047 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -118,7 +118,7 @@ fn consume_non_eol_whitespace(rdr: string_reader) { } fn push_blank_line_comment(rdr: string_reader, &comments: ~[cmnt]) { - debug!{">>> blank-line comment"}; + debug!(">>> blank-line comment"); let v: ~[~str] = ~[]; vec::push(comments, {style: blank_line, lines: v, pos: rdr.chpos}); } @@ -136,9 +136,9 @@ fn consume_whitespace_counting_blank_lines(rdr: string_reader, fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool, &comments: ~[cmnt]) { - debug!{">>> shebang comment"}; + debug!(">>> shebang comment"); let p = rdr.chpos; - debug!{"<<< shebang comment"}; + debug!("<<< shebang comment"); vec::push(comments, { style: if code_to_the_left { trailing } else { isolated }, lines: ~[read_one_line_comment(rdr)], @@ -148,7 +148,7 @@ fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool, fn read_line_comments(rdr: string_reader, code_to_the_left: bool, &comments: ~[cmnt]) { - debug!{">>> line comments"}; + debug!(">>> line comments"); let p = rdr.chpos; let mut lines: ~[~str] = ~[]; while rdr.curr == '/' && nextch(rdr) == '/' { @@ -160,7 +160,7 @@ fn read_line_comments(rdr: string_reader, code_to_the_left: bool, vec::push(lines, line); consume_non_eol_whitespace(rdr); } - debug!{"<<< line comments"}; + debug!("<<< line comments"); if !lines.is_empty() { vec::push(comments, { style: if code_to_the_left { trailing } else { isolated }, @@ -193,7 +193,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: ~[~str], fn read_block_comment(rdr: string_reader, code_to_the_left: bool, &comments: ~[cmnt]) { - debug!{">>> block comment"}; + debug!(">>> block comment"); let p = rdr.chpos; let mut lines: ~[~str] = ~[]; let mut col: uint = rdr.col; @@ -215,7 +215,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool, let mut curr_line = ~"/*"; let mut level: int = 1; while level > 0 { - debug!{"=== block comment level %d", level}; + debug!("=== block comment level %d", level); if is_eof(rdr) {(rdr as reader).fatal(~"unterminated block comment");} if rdr.curr == '\n' { trim_whitespace_prefix_and_push_line(lines, curr_line, col); @@ -246,7 +246,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool, if !is_eof(rdr) && rdr.curr != '\n' && vec::len(lines) == 1u { style = mixed; } - debug!{"<<< block comment"}; + debug!("<<< block comment"); vec::push(comments, {style: style, lines: lines, pos: p}); } @@ -258,7 +258,7 @@ fn peeking_at_comment(rdr: string_reader) -> bool { fn consume_comment(rdr: string_reader, code_to_the_left: bool, &comments: ~[cmnt]) { - debug!{">>> consume comment"}; + debug!(">>> consume comment"); if rdr.curr == '/' && nextch(rdr) == '/' { read_line_comments(rdr, code_to_the_left, comments); } else if rdr.curr == '/' && nextch(rdr) == '*' { @@ -266,7 +266,7 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool, } else if rdr.curr == '#' && nextch(rdr) == '!' { read_shebang_comment(rdr, code_to_the_left, comments); } else { fail; } - debug!{"<<< consume comment"}; + debug!("<<< consume comment"); } type lit = {lit: ~str, pos: uint}; diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 1d260268d3f..afb9c91fc8d 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -115,7 +115,7 @@ impl parser: parser_common { // A sanity check that the word we are asking for is a known keyword fn require_keyword(word: ~str) { if !self.keywords.contains_key_ref(&word) { - self.bug(fmt!{"unknown keyword: %s", word}); + self.bug(fmt!("unknown keyword: %s", word)); } } diff --git a/src/libsyntax/parse/eval.rs b/src/libsyntax/parse/eval.rs index 60d2fadb04c..2eafa4a6f34 100644 --- a/src/libsyntax/parse/eval.rs +++ b/src/libsyntax/parse/eval.rs @@ -20,9 +20,9 @@ fn eval_crate_directives(cx: ctx, fn eval_crate_directives_to_mod(cx: ctx, cdirs: ~[@ast::crate_directive], prefix: ~str, suffix: option<~str>) -> (ast::_mod, ~[ast::attribute]) { - debug!{"eval crate prefix: %s", prefix}; - debug!{"eval crate suffix: %s", - option::get_default(suffix, ~"none")}; + debug!("eval crate prefix: %s", prefix); + debug!("eval crate suffix: %s", + option::get_default(suffix, ~"none")); let (cview_items, citems, cattrs) = parse_companion_mod(cx, prefix, suffix); let mut view_items: ~[@ast::view_item] = ~[]; @@ -63,9 +63,9 @@ fn parse_companion_mod(cx: ctx, prefix: ~str, suffix: option<~str>) } let modpath = companion_file(prefix, suffix); - debug!{"looking for companion mod %s", modpath}; + debug!("looking for companion mod %s", modpath); if file_exists(modpath) { - debug!{"found companion mod"}; + debug!("found companion mod"); let (p0, r0) = new_parser_etc_from_file(cx.sess, cx.cfg, modpath, SOURCE_FILE); let inner_attrs = p0.parse_inner_attrs_and_next(); diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index a796073c9dd..854633aa06e 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -419,8 +419,8 @@ fn scan_number(c: char, rdr: string_reader) -> token::token { } let parsed = option::get(u64::from_str_radix(num_str, base as u64)); - debug!{"lexing %s as an unsuffixed integer literal", - num_str}; + debug!("lexing %s as an unsuffixed integer literal", + num_str); return token::LIT_INT_UNSUFFIXED(parsed as i64); } } @@ -431,7 +431,7 @@ fn scan_numeric_escape(rdr: string_reader, n_hex_digits: uint) -> char { let n = rdr.curr; bump(rdr); if !is_hex_digit(n) { - rdr.fatal(fmt!{"illegal numeric character escape: %d", n as int}); + rdr.fatal(fmt!("illegal numeric character escape: %d", n as int)); } accum_int *= 16; accum_int += hex_digit_val(n); @@ -578,7 +578,7 @@ fn next_token_inner(rdr: string_reader) -> token::token { 'u' => { c2 = scan_numeric_escape(rdr, 4u); } 'U' => { c2 = scan_numeric_escape(rdr, 8u); } c2 => { - rdr.fatal(fmt!{"unknown character escape: %d", c2 as int}); + rdr.fatal(fmt!("unknown character escape: %d", c2 as int)); } } } @@ -593,8 +593,8 @@ fn next_token_inner(rdr: string_reader) -> token::token { bump(rdr); while rdr.curr != '"' { if is_eof(rdr) { - rdr.fatal(fmt!{"unterminated double quote string: %s", - get_str_from(rdr, n)}); + rdr.fatal(fmt!("unterminated double quote string: %s", + get_str_from(rdr, n))); } let ch = rdr.curr; @@ -621,7 +621,7 @@ fn next_token_inner(rdr: string_reader) -> token::token { str::push_char(accum_str, scan_numeric_escape(rdr, 8u)); } c2 => { - rdr.fatal(fmt!{"unknown string escape: %d", c2 as int}); + rdr.fatal(fmt!("unknown string escape: %d", c2 as int)); } } } @@ -656,7 +656,7 @@ fn next_token_inner(rdr: string_reader) -> token::token { '/' => { return binop(rdr, token::SLASH); } '^' => { return binop(rdr, token::CARET); } '%' => { return binop(rdr, token::PERCENT); } - c => { rdr.fatal(fmt!{"unknown start of token: %d", c as int}); } + c => { rdr.fatal(fmt!("unknown start of token: %d", c as int)); } } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f81d6de25b4..2aef7c99dbc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -126,7 +126,7 @@ enum view_item_parse_mode { /* The expr situation is not as complex as I thought it would be. The important thing is to make sure that lookahead doesn't balk at INTERPOLATED tokens */ -macro_rules! maybe_whole_expr { +macro_rules! maybe_whole_expr ( {$p:expr} => { match copy $p.token { INTERPOLATED(token::nt_expr(e)) => { $p.bump(); @@ -139,9 +139,9 @@ macro_rules! maybe_whole_expr { } _ => () }} -} +) -macro_rules! maybe_whole { +macro_rules! maybe_whole ( {$p:expr, $constructor:ident} => { match copy $p.token { INTERPOLATED(token::$constructor(x)) => { $p.bump(); return x; } _ => () @@ -166,7 +166,7 @@ macro_rules! maybe_whole { _ => () }} -} +) pure fn maybe_append(+lhs: ~[attribute], rhs: option<~[attribute]>) @@ -325,13 +325,13 @@ struct parser { let self_ty = if is_static { static_sty } else { self_ty }; let hi = p.last_span.hi; - debug!{"parse_trait_methods(): trait method signature ends in \ + debug!("parse_trait_methods(): trait method signature ends in \ `%s`", - token_to_str(p.reader, p.token)}; + token_to_str(p.reader, p.token)); match p.token { token::SEMI => { p.bump(); - debug!{"parse_trait_methods(): parsing required method"}; + debug!("parse_trait_methods(): parsing required method"); // NB: at the moment, visibility annotations on required // methods are ignored; this could change. required({ident: ident, attrs: attrs, @@ -340,7 +340,7 @@ struct parser { id: p.get_id(), span: mk_sp(lo, hi)}) } token::LBRACE => { - debug!{"parse_trait_methods(): parsing provided method"}; + debug!("parse_trait_methods(): parsing provided method"); let (inner_attrs, body) = p.parse_inner_attrs_and_block(true); let attrs = vec::append(attrs, inner_attrs); @@ -441,7 +441,7 @@ struct parser { } fn parse_ty(colons_before_params: bool) -> @ty { - maybe_whole!{self, nt_ty}; + maybe_whole!(self, nt_ty); let lo = self.span.lo; @@ -708,7 +708,7 @@ struct parser { parse_ident: fn(parser) -> ident, parse_last_ident: fn(parser) -> ident) -> @path { - maybe_whole!{self, nt_path}; + maybe_whole!(self, nt_path); let lo = self.span.lo; let global = self.eat(token::MOD_SEP); let mut ids = ~[]; @@ -735,9 +735,9 @@ struct parser { } fn parse_path_with_tps(colons: bool) -> @path { - debug!{"parse_path_with_tps(colons=%b)", colons}; + debug!("parse_path_with_tps(colons=%b)", colons); - maybe_whole!{self, nt_path}; + maybe_whole!(self, nt_path); let lo = self.span.lo; let path = self.parse_path_without_tps(); if colons && !self.eat(token::MOD_SEP) { @@ -829,7 +829,7 @@ struct parser { } fn parse_bottom_expr() -> pexpr { - maybe_whole_expr!{self}; + maybe_whole_expr!(self); let lo = self.span.lo; let mut hi = self.span.hi; @@ -1197,7 +1197,7 @@ struct parser { } fn parse_token_tree() -> token_tree { - maybe_whole!{deref self, nt_tt}; + maybe_whole!(deref self, nt_tt); fn parse_tt_tok(p: parser, delim_ok: bool) -> token_tree { match p.token { @@ -1249,7 +1249,7 @@ struct parser { fn parse_matchers() -> ~[matcher] { // unification of matchers and token_trees would vastly improve // the interpolation of matchers - maybe_whole!{self, nt_matchers}; + maybe_whole!(self, nt_matchers); let name_idx = @mut 0u; return match self.token { token::LBRACE | token::LPAREN | token::LBRACKET => { @@ -1598,9 +1598,9 @@ struct parser { // There may be other types of expressions that can // represent the callee in `for` and `do` expressions // but they aren't represented by tests - debug!{"sugary call on %?", e.node}; + debug!("sugary call on %?", e.node); self.span_fatal( - lo, fmt!{"`%s` must be followed by a block call", keyword}); + lo, fmt!("`%s` must be followed by a block call", keyword)); } } } @@ -1801,7 +1801,7 @@ struct parser { } fn parse_pat(refutable: bool) -> @pat { - maybe_whole!{self, nt_pat}; + maybe_whole!(self, nt_pat); let lo = self.span.lo; let mut hi = self.span.hi; @@ -2077,7 +2077,7 @@ struct parser { } fn parse_stmt(+first_item_attrs: ~[attribute]) -> @stmt { - maybe_whole!{self, nt_stmt}; + maybe_whole!(self, nt_stmt); fn check_expected_item(p: parser, current_attrs: ~[attribute]) { // If we have attributes then we should have an item @@ -2140,7 +2140,7 @@ struct parser { fn parse_inner_attrs_and_block(parse_attrs: bool) -> (~[attribute], blk) { - maybe_whole!{pair_empty self, nt_block}; + maybe_whole!(pair_empty self, nt_block); fn maybe_parse_inner_attrs_and_next(p: parser, parse_attrs: bool) -> {inner: ~[attribute], next: ~[attribute]} { @@ -2812,7 +2812,7 @@ struct parser { token_to_str(self.reader, self.token) + ~"`"); } } - debug!{"parse_mod_items: attrs=%?", attrs}; + debug!("parse_mod_items: attrs=%?", attrs); } if first && attrs_remaining.len() > 0u { @@ -3139,7 +3139,7 @@ struct parser { fn parse_item_or_view_item(+attrs: ~[attribute], items_allowed: bool) -> item_or_view_item { - maybe_whole!{iovi self,nt_item}; + maybe_whole!(iovi self,nt_item); let lo = self.span.lo; let visibility; @@ -3303,7 +3303,7 @@ struct parser { let lo = self.span.lo; let first_ident = self.parse_ident(); let mut path = ~[first_ident]; - debug!{"parsed view_path: %s", *self.id_to_str(first_ident)}; + debug!("parsed view_path: %s", *self.id_to_str(first_ident)); match self.token { token::EQ => { // x = foo::bar diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 7282eaafb79..fbca90b5f49 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -63,7 +63,7 @@ enum token { STRING(@~str, int), BREAK(break_t), BEGIN(begin_t), END, EOF, } fn tok_str(++t: token) -> ~str { match t { - STRING(s, len) => return fmt!{"STR(%s,%d)", *s, len}, + STRING(s, len) => return fmt!("STR(%s,%d)", *s, len), BREAK(_) => return ~"BREAK", BEGIN(_) => return ~"BEGIN", END => return ~"END", @@ -81,7 +81,7 @@ fn buf_str(toks: ~[mut token], szs: ~[mut int], left: uint, right: uint, while i != right && L != 0u { L -= 1u; if i != left { s += ~", "; } - s += fmt!{"%d=%s", szs[i], tok_str(toks[i])}; + s += fmt!("%d=%s", szs[i], tok_str(toks[i])); i += 1u; i %= n; } @@ -99,7 +99,7 @@ fn mk_printer(out: io::Writer, linewidth: uint) -> printer { // Yes 3, it makes the ring buffers big enough to never // fall behind. let n: uint = 3u * linewidth; - debug!{"mk_printer %u", linewidth}; + debug!("mk_printer %u", linewidth); let token: ~[mut token] = vec::to_mut(vec::from_elem(n, EOF)); let size: ~[mut int] = vec::to_mut(vec::from_elem(n, 0)); let scan_stack: ~[mut uint] = vec::to_mut(vec::from_elem(n, 0u)); @@ -237,7 +237,7 @@ impl printer { // be very careful with this! fn replace_last_token(t: token) { self.token[self.right] = t; } fn pretty_print(t: token) { - debug!{"pp ~[%u,%u]", self.left, self.right}; + debug!("pp ~[%u,%u]", self.left, self.right); match t { EOF => { if !self.scan_stack_empty { @@ -254,18 +254,18 @@ impl printer { self.left = 0u; self.right = 0u; } else { self.advance_right(); } - debug!{"pp BEGIN(%d)/buffer ~[%u,%u]", - b.offset, self.left, self.right}; + debug!("pp BEGIN(%d)/buffer ~[%u,%u]", + b.offset, self.left, self.right); self.token[self.right] = t; self.size[self.right] = -self.right_total; self.scan_push(self.right); } END => { if self.scan_stack_empty { - debug!{"pp END/print ~[%u,%u]", self.left, self.right}; + debug!("pp END/print ~[%u,%u]", self.left, self.right); self.print(t, 0); } else { - debug!{"pp END/buffer ~[%u,%u]", self.left, self.right}; + debug!("pp END/buffer ~[%u,%u]", self.left, self.right); self.advance_right(); self.token[self.right] = t; self.size[self.right] = -1; @@ -279,8 +279,8 @@ impl printer { self.left = 0u; self.right = 0u; } else { self.advance_right(); } - debug!{"pp BREAK(%d)/buffer ~[%u,%u]", - b.offset, self.left, self.right}; + debug!("pp BREAK(%d)/buffer ~[%u,%u]", + b.offset, self.left, self.right); self.check_stack(0); self.scan_push(self.right); self.token[self.right] = t; @@ -289,12 +289,12 @@ impl printer { } STRING(s, len) => { if self.scan_stack_empty { - debug!{"pp STRING('%s')/print ~[%u,%u]", - *s, self.left, self.right}; + debug!("pp STRING('%s')/print ~[%u,%u]", + *s, self.left, self.right); self.print(t, len); } else { - debug!{"pp STRING('%s')/buffer ~[%u,%u]", - *s, self.left, self.right}; + debug!("pp STRING('%s')/buffer ~[%u,%u]", + *s, self.left, self.right); self.advance_right(); self.token[self.right] = t; self.size[self.right] = len; @@ -305,14 +305,14 @@ impl printer { } } fn check_stream() { - debug!{"check_stream ~[%u, %u] with left_total=%d, right_total=%d", - self.left, self.right, self.left_total, self.right_total}; + debug!("check_stream ~[%u, %u] with left_total=%d, right_total=%d", + self.left, self.right, self.left_total, self.right_total); if self.right_total - self.left_total > self.space { - debug!{"scan window is %d, longer than space on line (%d)", - self.right_total - self.left_total, self.space}; + debug!("scan window is %d, longer than space on line (%d)", + self.right_total - self.left_total, self.space); if !self.scan_stack_empty { if self.left == self.scan_stack[self.bottom] { - debug!{"setting %u to infinity and popping", self.left}; + debug!("setting %u to infinity and popping", self.left); self.size[self.scan_pop_bottom()] = size_infinity; } } @@ -321,7 +321,7 @@ impl printer { } } fn scan_push(x: uint) { - debug!{"scan_push %u", x}; + debug!("scan_push %u", x); if self.scan_stack_empty { self.scan_stack_empty = false; } else { @@ -357,8 +357,8 @@ impl printer { assert (self.right != self.left); } fn advance_left(++x: token, L: int) { - debug!{"advnce_left ~[%u,%u], sizeof(%u)=%d", self.left, self.right, - self.left, L}; + debug!("advnce_left ~[%u,%u], sizeof(%u)=%d", self.left, self.right, + self.left, L); if L >= 0 { self.print(x, L); match x { @@ -398,13 +398,13 @@ impl printer { } } fn print_newline(amount: int) { - debug!{"NEWLINE %d", amount}; + debug!("NEWLINE %d", amount); self.out.write_str(~"\n"); self.pending_indentation = 0; self.indent(amount); } fn indent(amount: int) { - debug!{"INDENT %d", amount}; + debug!("INDENT %d", amount); self.pending_indentation += amount; } fn get_top() -> print_stack_elt { @@ -423,24 +423,24 @@ impl printer { self.out.write_str(s); } fn print(x: token, L: int) { - debug!{"print %s %d (remaining line space=%d)", tok_str(x), L, - self.space}; + debug!("print %s %d (remaining line space=%d)", tok_str(x), L, + self.space); log(debug, buf_str(self.token, self.size, self.left, self.right, 6u)); match x { BEGIN(b) => { if L > self.space { let col = self.margin - self.space + b.offset; - debug!{"print BEGIN -> push broken block at col %d", col}; + debug!("print BEGIN -> push broken block at col %d", col); self.print_stack.push({offset: col, pbreak: broken(b.breaks)}); } else { - debug!{"print BEGIN -> push fitting block"}; + debug!("print BEGIN -> push fitting block"); self.print_stack.push({offset: 0, pbreak: fits}); } } END => { - debug!{"print END -> pop END"}; + debug!("print END -> pop END"); assert (self.print_stack.len() != 0u); self.print_stack.pop(); } @@ -448,25 +448,25 @@ impl printer { let top = self.get_top(); match top.pbreak { fits => { - debug!{"print BREAK(%d) in fitting block", b.blank_space}; + debug!("print BREAK(%d) in fitting block", b.blank_space); self.space -= b.blank_space; self.indent(b.blank_space); } broken(consistent) => { - debug!{"print BREAK(%d+%d) in consistent block", - top.offset, b.offset}; + debug!("print BREAK(%d+%d) in consistent block", + top.offset, b.offset); self.print_newline(top.offset + b.offset); self.space = self.margin - (top.offset + b.offset); } broken(inconsistent) => { if L > self.space { - debug!{"print BREAK(%d+%d) w/ newline in inconsistent", - top.offset, b.offset}; + debug!("print BREAK(%d+%d) w/ newline in inconsistent", + top.offset, b.offset); self.print_newline(top.offset + b.offset); self.space = self.margin - (top.offset + b.offset); } else { - debug!{"print BREAK(%d) w/o newline in inconsistent", - b.blank_space}; + debug!("print BREAK(%d) w/o newline in inconsistent", + b.blank_space); self.indent(b.blank_space); self.space -= b.blank_space; } @@ -474,7 +474,7 @@ impl printer { } } STRING(s, len) => { - debug!{"print STRING(%s)", *s}; + debug!("print STRING(%s)", *s); assert (L == len); // assert L <= space; self.space -= len; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 04f800a7238..8320d438b4e 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -937,14 +937,14 @@ fn print_mac(s: ps, m: ast::mac) { bclose(s, m.span); } ast::mac_ellipsis => word(s.s, ~"..."), - ast::mac_var(v) => word(s.s, fmt!{"$%u", v}), + ast::mac_var(v) => word(s.s, fmt!("$%u", v)), _ => { /* fixme */ } } } fn print_vstore(s: ps, t: ast::vstore) { match t { - ast::vstore_fixed(some(i)) => word(s.s, fmt!{"%u", i}), + ast::vstore_fixed(some(i)) => word(s.s, fmt!("%u", i)), ast::vstore_fixed(none) => word(s.s, ~"_"), ast::vstore_uniq => word(s.s, ~"~"), ast::vstore_box => word(s.s, ~"@"), |
