about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-06-07 10:41:18 -0700
committerJohn Clements <clements@racket-lang.org>2013-09-06 13:35:08 -0700
commitd1c01734f3a34958333fefb2fe91cea5e753ddd7 (patch)
tree94bd464d5a1f35be8d89406de648ecacd367dda4 /src/libsyntax/parse
parent7bf75adfd904642022a048c34440ec4b5dfd567d (diff)
downloadrust-d1c01734f3a34958333fefb2fe91cea5e753ddd7.tar.gz
rust-d1c01734f3a34958333fefb2fe91cea5e753ddd7.zip
drop back to a simple gensym approach for fresh-name.
this is necessary so that the new idents are connected to the original strings.
this is important both for error messages, and so that top-level refs get connected
to the right things.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 66f121727af..6cdde3708a6 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -543,18 +543,9 @@ pub fn gensym_ident(str : &str) -> ast::Ident {
     ast::Ident::new(gensym(str))
 }
 
-
-// create a fresh name. In principle, this is just a
-// gensym, but for debugging purposes, you'd like the
-// resulting name to have a suggestive stringify, without
-// paying the cost of guaranteeing that the name is
-// truly unique.  I'm going to try to strike a balance
-// by using a gensym with a name that has a random number
-// at the end. So, the gensym guarantees the uniqueness,
-// and the int helps to avoid confusion.
-pub fn fresh_name(src_name : &ast::Ident) -> Name {
-    let num = rand::rng().gen_uint_range(0,0xffff);
-    gensym(fmt!("%s_%u",ident_to_str(src_name),num))
+// create a fresh name that maps to the same string as the old one.
+pub fn fresh_name(src : &ast::Ident) -> Name {
+    gensym(ident_to_str(src))
 }
 
 // create a fresh mark.