about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-01-31 16:10:06 -0800
committerHuon Wilson <dbau.pp+github@gmail.com>2014-02-02 01:44:49 +1100
commite5dc347ccfe92d9d1dd23f0b4a257a1cb3532462 (patch)
treec6540425182aabfc4fde8e45564c4f50c796c7e5 /src/libsyntax/parse
parenta695b62118ffd1ed1df5e4898cb34d7d58b91bc1 (diff)
downloadrust-e5dc347ccfe92d9d1dd23f0b4a257a1cb3532462.tar.gz
rust-e5dc347ccfe92d9d1dd23f0b4a257a1cb3532462.zip
libsyntax: Remove the `interner_get` function and all uses
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
-rw-r--r--src/libsyntax/parse/token.rs27
2 files changed, 2 insertions, 28 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 34080ffb624..86913711801 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4178,7 +4178,8 @@ impl Parser {
                 outer_attrs, "path") {
             Some(d) => dir_path.join(d),
             None => {
-                let mod_name = token::interner_get(id.name).to_owned();
+                let mod_string = token::get_ident(id.name);
+                let mod_name = mod_string.get().to_owned();
                 let default_path_str = mod_name + ".rs";
                 let secondary_path_str = mod_name + "/mod.rs";
                 let default_path = dir_path.join(default_path_str.as_slice());
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 2c57a4effd5..806c84c5553 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -651,11 +651,6 @@ pub fn gensym(str : &str) -> Name {
     interner.gensym(str)
 }
 
-// map an interned representation back to a string
-pub fn interner_get(name : Name) -> @str {
-    get_ident_interner().get(name)
-}
-
 // maps a string to an identifier with an empty syntax context
 pub fn str_to_ident(str : &str) -> ast::Ident {
     ast::Ident::new(intern(str))
@@ -679,28 +674,6 @@ pub fn fresh_name(src : &ast::Ident) -> Name {
     gensym(format!("{}_{}",ident_to_str(src),num))*/
 }
 
-// it looks like there oughta be a str_ptr_eq fn, but no one bothered to implement it?
-
-// determine whether two @str values are pointer-equal
-pub fn str_ptr_eq(a : @str, b : @str) -> bool {
-    unsafe {
-        let p : uint = cast::transmute(a);
-        let q : uint = cast::transmute(b);
-        let result = p == q;
-        // got to transmute them back, to make sure the ref count is correct:
-        let _junk1 : @str = cast::transmute(p);
-        let _junk2 : @str = cast::transmute(q);
-        result
-    }
-}
-
-// return true when two identifiers refer (through the intern table) to the same ptr_eq
-// string. This is used to compare identifiers in places where hygienic comparison is
-// not wanted (i.e. not lexical vars).
-pub fn ident_spelling_eq(a : &ast::Ident, b : &ast::Ident) -> bool {
-    str_ptr_eq(interner_get(a.name),interner_get(b.name))
-}
-
 // create a fresh mark.
 pub fn fresh_mark() -> Mrk {
     gensym("mark")