]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/quote.rs
syntax: Remove use of `pub use` globs
[rust.git] / src / libsyntax / ext / quote.rs
index 62e052b0bb91c78a09b69654add52bd4586da4a1..56bf0309e93ac7a1f007ff1bda2ffc81b28a8f36 100644 (file)
@@ -36,8 +36,17 @@ pub mod rt {
     use parse;
     use print::pprust;
 
-    pub use ast::*;
-    pub use parse::token::*;
+    #[cfg(not(stage0))]
+    use ast::{TokenTree, Generics, Expr};
+
+    // NOTE remove this after snapshot
+    // (stage0 quasiquoter needs this)
+    #[cfg(stage0)]
+    pub use ast::{Generics, TokenTree, TTTok};
+    #[cfg(stage0)]
+    pub use parse::token::{IDENT, SEMI, LBRACE, RBRACE, LIFETIME, COLON, AND, BINOP, EQ,
+                           LBRACKET, RBRACKET, LPAREN, RPAREN, POUND, NOT, MOD_SEP, DOT, COMMA};
+
     pub use parse::new_parser_from_tts;
     pub use codemap::{BytePos, Span, dummy_spanned};
 
@@ -72,7 +81,7 @@ pub trait ToSource {
 
     impl ToSource for ast::Ident {
         fn to_source(&self) -> String {
-            get_ident(*self).get().to_string()
+            token::get_ident(*self).get().to_string()
         }
     }
 
@@ -685,11 +694,14 @@ fn expand_wrapper(cx: &ExtCtxt,
                   sp: Span,
                   cx_expr: @ast::Expr,
                   expr: @ast::Expr) -> @ast::Expr {
-    let uses = vec![ cx.view_use_glob(sp, ast::Inherited,
-                                   ids_ext(vec!["syntax".to_string(),
-                                                "ext".to_string(),
-                                                "quote".to_string(),
-                                                "rt".to_string()])) ];
+    let uses = [
+        &["syntax", "ast"],
+        &["syntax", "parse", "token"],
+        &["syntax", "ext", "quote", "rt"],
+    ].iter().map(|path| {
+        let path = path.iter().map(|s| s.to_string()).collect();
+        cx.view_use_glob(sp, ast::Inherited, ids_ext(path))
+    }).collect();
 
     let stmt_let_ext_cx = cx.stmt_let(sp, false, id_ext("ext_cx"), cx_expr);