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};
impl ToSource for ast::Ident {
fn to_source(&self) -> String {
- get_ident(*self).get().to_string()
+ token::get_ident(*self).get().to_string()
}
}
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);