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/ext | |
| parent | 226fd87199fb0184fb39ffc5dff3865cfdc9f362 (diff) | |
| download | rust-29f32b4a7298b0807408658bc8add1de8a06ab12.tar.gz rust-29f32b4a7298b0807408658bc8add1de8a06ab12.zip | |
`m1!{...}` -> `m1!(...)`
Diffstat (limited to 'src/libsyntax/ext')
| -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 |
13 files changed, 97 insertions, 97 deletions
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))); } } } |
