about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-11-29 02:07:12 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-18 23:26:22 +0000
commit59de7f8f04d9122dd776f2edd73eb77a4fc94054 (patch)
tree9ed1e83114aaa9cbdc3157414429349916507760 /src/libsyntax
parent83ab9f7faccddee23545e12d323791f9e2d06380 (diff)
downloadrust-59de7f8f04d9122dd776f2edd73eb77a4fc94054.tar.gz
rust-59de7f8f04d9122dd776f2edd73eb77a4fc94054.zip
Add `ident.unhygienize()` and use `Ident` more instead of `Name` in `resolve`.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 2a911aceb9d..2369cc5714e 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -47,10 +47,14 @@ impl Ident {
         Ident { name: name, ctxt: SyntaxContext::empty() }
     }
 
-   /// Maps a string to an identifier with an empty syntax context.
-   pub fn from_str(s: &str) -> Ident {
-       Ident::with_empty_ctxt(Symbol::intern(s))
-   }
+    /// Maps a string to an identifier with an empty syntax context.
+    pub fn from_str(s: &str) -> Ident {
+        Ident::with_empty_ctxt(Symbol::intern(s))
+    }
+
+    pub fn unhygienize(&self) -> Ident {
+        Ident { name: self.name, ctxt: SyntaxContext::empty() }
+    }
 }
 
 impl fmt::Debug for Ident {