summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-06-03 23:00:49 -0700
committerJohn Clements <clements@racket-lang.org>2013-06-05 12:01:38 -0700
commit04a691a511d0203b1f521960f845e623cc45d261 (patch)
tree06693e51a145e83c36ab9dab9728946fa2c7634d /src/libsyntax/ext/tt
parent320359547126b1a317d49ed68102d1b6e8be5ca2 (diff)
downloadrust-04a691a511d0203b1f521960f845e623cc45d261.tar.gz
rust-04a691a511d0203b1f521960f845e623cc45d261.zip
token_to_ident takes argument by reference
Diffstat (limited to 'src/libsyntax/ext/tt')
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs8
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs2
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 86077a5c0b3..9fb9def84e9 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -205,7 +205,7 @@ pub fn nameize(p_s: @mut ParseSess, ms: &[matcher], res: &[@named_match])
           } => {
             if ret_val.contains_key(bind_name) {
                 p_s.span_diagnostic.span_fatal(sp, ~"Duplicated bind name: "+
-                                               *ident_to_str(*bind_name))
+                                               *ident_to_str(bind_name))
             }
             ret_val.insert(*bind_name, res[idx]);
           }
@@ -373,8 +373,8 @@ pub fn parse(
                 let nts = str::connect(vec::map(bb_eis, |ei| {
                     match ei.elts[ei.idx].node {
                       match_nonterminal(ref bind,ref name,_) => {
-                        fmt!("%s ('%s')", *ident_to_str(*name),
-                             *ident_to_str(*bind))
+                        fmt!("%s ('%s')", *ident_to_str(name),
+                             *ident_to_str(bind))
                       }
                       _ => fail!()
                     } }), " or ");
@@ -398,7 +398,7 @@ pub fn parse(
                 match ei.elts[ei.idx].node {
                   match_nonterminal(_, ref name, idx) => {
                     ei.matches[idx].push(@matched_nonterminal(
-                        parse_nt(&rust_parser, *ident_to_str(*name))));
+                        parse_nt(&rust_parser, *ident_to_str(name))));
                     ei.idx += 1u;
                   }
                   _ => fail!()
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index be2c50d223d..140c89807f4 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -151,7 +151,7 @@ pub fn add_new_extension(cx: @ExtCtxt,
         |cx, sp, arg| generic_extension(cx, sp, name, arg, *lhses, *rhses);
 
     return MRDef(MacroDef{
-        name: copy *ident_to_str(name),
+        name: copy *ident_to_str(&name),
         ext: NormalTT(base::SyntaxExpanderTT{expander: exp, span: Some(sp)})
     });
 }
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index 8ff66dc62e3..fcd440420a1 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -145,8 +145,8 @@ fn lockstep_iter_size(t: &token_tree, r: &mut TtReader) -> lis {
             lis_contradiction(_) => copy rhs,
             lis_constraint(r_len, _) if l_len == r_len => copy lhs,
             lis_constraint(r_len, ref r_id) => {
-                let l_n = copy *ident_to_str(*l_id);
-                let r_n = copy *ident_to_str(*r_id);
+                let l_n = copy *ident_to_str(l_id);
+                let r_n = copy *ident_to_str(r_id);
                 lis_contradiction(fmt!("Inconsistent lockstep iteration: \
                                        '%s' has %u items, but '%s' has %u",
                                         l_n, l_len, r_n, r_len))
@@ -296,7 +296,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
                 r.sp_diag.span_fatal(
                     copy r.cur_span, /* blame the macro writer */
                     fmt!("variable '%s' is still repeating at this depth",
-                         *ident_to_str(ident)));
+                         *ident_to_str(&ident)));
               }
             }
           }