diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-11-29 02:07:12 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-12-18 23:26:22 +0000 |
| commit | 59de7f8f04d9122dd776f2edd73eb77a4fc94054 (patch) | |
| tree | 9ed1e83114aaa9cbdc3157414429349916507760 /src/libsyntax | |
| parent | 83ab9f7faccddee23545e12d323791f9e2d06380 (diff) | |
| download | rust-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.rs | 12 |
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 { |
