diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-16 00:16:13 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-11 09:11:40 -0700 |
| commit | 53ad426e92f8099a701f3f54c02dc8f069f5939a (patch) | |
| tree | cef835fc4f6319f12bf1c47c90682bdbcf17afac /src/libsyntax/parse/token.rs | |
| parent | 531ed3d599000de2517cba102c83fe44a1f1e252 (diff) | |
| download | rust-53ad426e92f8099a701f3f54c02dc8f069f5939a.tar.gz rust-53ad426e92f8099a701f3f54c02dc8f069f5939a.zip | |
syntax: Move the AST from @T to Gc<T>
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 129ea5fdf6d..fa70261a7d7 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -18,10 +18,10 @@ use util::interner; use serialize::{Decodable, Decoder, Encodable, Encoder}; use std::fmt; -use std::path::BytesContainer; +use std::gc::Gc; use std::mem; +use std::path::BytesContainer; use std::rc::Rc; -use std::string::String; #[allow(non_camel_case_types)] #[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)] @@ -105,16 +105,16 @@ pub enum Token { #[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { - NtItem(@ast::Item), + NtItem(Gc<ast::Item>), NtBlock(P<ast::Block>), - NtStmt(@ast::Stmt), - NtPat( @ast::Pat), - NtExpr(@ast::Expr), + NtStmt(Gc<ast::Stmt>), + NtPat( Gc<ast::Pat>), + NtExpr(Gc<ast::Expr>), NtTy( P<ast::Ty>), NtIdent(Box<ast::Ident>, bool), - NtMeta(@ast::MetaItem), // stuff inside brackets for attributes + NtMeta(Gc<ast::MetaItem>), // stuff inside brackets for attributes NtPath(Box<ast::Path>), - NtTT( @ast::TokenTree), // needs @ed to break a circularity + NtTT( Gc<ast::TokenTree>), // needs @ed to break a circularity NtMatchers(Vec<ast::Matcher> ) } @@ -241,8 +241,8 @@ pub fn to_str(t: &Token) -> String { EOF => "<eof>".to_string(), INTERPOLATED(ref nt) => { match nt { - &NtExpr(e) => ::print::pprust::expr_to_str(e), - &NtMeta(e) => ::print::pprust::meta_item_to_str(e), + &NtExpr(ref e) => ::print::pprust::expr_to_str(&**e), + &NtMeta(ref e) => ::print::pprust::meta_item_to_str(&**e), _ => { let mut s = "an interpolated ".to_string(); match *nt { |
