quasi 0.3.1

A quasi-quoting macro system
b0VIM 7.4�U�9�wericktErick-Tryzelaar-MBP.local~erickt/projects/rust/rust-quasi/quasi/src/lib.rsutf-8
3210#"! UtpwxxY�ad�w�{XU��M)(�
�
�
�
�
x
c
b
Q
P

��|aML7�������~}R�
�
�
�
�
�
u
>
'
!


�	�	t	n	l	k	?		������WB�������?976�|vtsW�����`
��KECB!�����`%�����_�    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtTraitItem(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::TraitItem> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtImplItem(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::ImplItem> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtItem(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Item> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtBlock(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Block> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtTy(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Ty> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtTy(P(self.clone()))))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Ty {}    }        vec![ast::TtToken(DUMMY_SP, token::Interpolated(token::NtPath(Box::new(self.clone()))))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Path {}    }        vec![ast::TtToken(DUMMY_SP, token::Ident(*self, token::Plain))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Ident {}    }        }            &None => Vec::new(),            &Some(ref t) => t.to_tokens(cx),        match self {    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl<T: ToTokens> ToTokens for Option<T> {}    }        self.node.to_tokens(cx)        // FIXME: use the span?    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl<T: ToTokens> ToTokens for Spanned<T> {}    }        self.iter().flat_map(|t| t.to_tokens(cx).into_iter()).collect()    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl<T: ToTokens> ToTokens for Vec<T> {}    }            .collect()            .flat_map(|t| t.to_tokens(cx).into_iter())        self.iter()    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl<'a, T: ToTokens> ToTokens for &'a [T] {}    }        (**self).to_tokens(cx)    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl<'a, T: ToTokens> ToTokens for &'a T {}    }        vec!(self.clone())    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for TokenTree {}    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>;pub trait ToTokens {use syntax::ptr::P;use syntax::print::pprust;use syntax::parse::{self, classify, parse_tts_from_source_str, token};use syntax::ext::base::ExtCtxt;use syntax::codemap::{DUMMY_SP, Spanned, dummy_spanned};use syntax::ast::{self, TokenTree, Generics, Expr};use std::rc::Rc;extern crate syntax;#[cfg(not(feature = "with-syntex"))]extern crate syntex_syntax as syntax;#[cfg(feature = "with-syntex")]#![cfg_attr(not(feature = "with-syntex"), feature(rustc_private))]// except according to those terms.// option. This file may not be copied, modified, or distributed// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or//// http://rust-lang.org/COPYRIGHT.// file at the top-level directory of this distribution and at// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHTadd�Y���vpnmT������LFDC!�
�
�
P
�����{\����zxwF�
�
�
�
S
!
�	�	�	�	m	8		����gf0���|vu?���>87��S��](����}    }                                         self.parse_sess())                                         self.cfg(),                                         s,        parse::parse_tts_from_source_str("<quote expansion>".to_string(),    fn parse_tts(&self, s: String) -> Vec<ast::TokenTree> {    }                                          self.parse_sess())                                          self.cfg(),                                          s,        parse::parse_expr_from_source_str("<quote expansion>".to_string(),    fn parse_expr(&self, s: String) -> P<ast::Expr> {    }                                          self.parse_sess()).expect("parse error")                                          self.cfg(),                                          s,        parse::parse_stmt_from_source_str("<quote expansion>".to_string(),    fn parse_stmt(&self, s: String) -> P<ast::Stmt> {    }            self.parse_sess()).expect("parse error")            self.cfg(),            s,            "<quote expansion>".to_string(),        parse::parse_item_from_source_str(    fn parse_item(&self, s: String) -> P<ast::Item> {impl<'a> ExtParseUtils for ExtCtxt<'a> {}    fn parse_tts(&self, s: String) -> Vec<ast::TokenTree>;    fn parse_stmt(&self, s: String) -> P<ast::Stmt>;    fn parse_expr(&self, s: String) -> P<ast::Expr>;    fn parse_item(&self, s: String) -> P<ast::Item>;pub trait ExtParseUtils {impl_to_tokens_int! { unsigned, u64,  ast::TyU64 }impl_to_tokens_int! { unsigned, u32,  ast::TyU32 }impl_to_tokens_int! { unsigned, u16,  ast::TyU16 }impl_to_tokens_int! { unsigned, u8,   ast::TyU8 }impl_to_tokens_int! { unsigned, usize, ast::TyUs }impl_to_tokens_int! { signed, i64, ast::TyI64 }impl_to_tokens_int! { signed, i32, ast::TyI32 }impl_to_tokens_int! { signed, i16, ast::TyI16 }impl_to_tokens_int! { signed, i8,  ast::TyI8 }impl_to_tokens_int! { signed, isize, ast::TyIs }}    );        }            }                dummy_spanned(lit).to_tokens(cx)                let lit = ast::LitInt(*self as u64, ast::UnsignedIntLit($tag));            fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {        impl ToTokens for $t {    (unsigned, $t:ty, $tag:expr) => (    );        }            }                dummy_spanned(lit).to_tokens(cx)                                                                      ast::Sign::new(*self)));                let lit = ast::LitInt(*self as u64, ast::SignedIntLit($tag,            fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {        impl ToTokens for $t {    (signed, $t:ty, $tag:expr) => (macro_rules! impl_to_tokens_int {}    }        dummy_spanned(ast::LitChar(*self)).to_tokens(cx)    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for char {}    }        dummy_spanned(ast::LitBool(*self)).to_tokens(cx)    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for bool {}    }        }).to_tokens(cx)            span: DUMMY_SP,            node: ast::ExprLit(P(self.clone())),            id: ast::DUMMY_NODE_ID,adx����on
��}UIH�
�
�
�
�
�
f



��XNMA;98��~|{[ �
�
�
�
�
h




	
�	�	�	d	@		���lZH:0)'&����P������wK���^;��������S4������p/�������E%        P(ast::Expr {        // FIXME: This is wrong    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Lit {}    }        }))]            close_span: DUMMY_SP,            tts: vec![],            open_span: DUMMY_SP,            delim: token::Paren,        vec![ast::TtDelimited(DUMMY_SP, Rc::new(ast::Delimited {    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for () {}    }        dummy_spanned(lit).to_tokens(cx)            token::intern_and_get_ident(self), ast::CookedStr);        let lit = ast::LitStr(    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for str {}    }        r        })));            close_span: self.span,            tts: self.node.value.to_tokens(cx),            open_span: self.span,            delim: token::Bracket,        r.push(ast::TtDelimited(self.span, Rc::new(ast::Delimited {        }            r.push(ast::TtToken(self.span, token::Not));        if self.node.style == ast::AttrInner {        r.push(ast::TtToken(self.span, token::Pound));        // FIXME: The spans could be better        let mut r = vec![];    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Attribute {}    }        vec![ast::TtToken(DUMMY_SP, token::Interpolated(token::NtMeta(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::MetaItem> {impl_to_tokens_slice! { P<ast::Item>, [] }impl_to_tokens_slice! { ast::Ty, [ast::TtToken(DUMMY_SP, token::Comma)] }}    };        }            }                v                }                    v.extend(x.to_tokens(cx));                    }                        v.extend($sep.iter().cloned());                    if i > 0 {                for (i, x) in self.iter().enumerate() {                let mut v = vec![];            fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {        impl ToTokens for [$t] {    ($t: ty, $sep: expr) => {macro_rules! impl_to_tokens_slice {}    }        vec![ast::TtToken(DUMMY_SP, token::Interpolated(token::NtArm(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Arm {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtPat(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Pat> {}    }        vec![ast::TtToken(self.span, token::Interpolated(token::NtExpr(self.clone())))]    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Expr> {}    }        tts        }            tts.push(ast::TtToken(self.span, token::Semi));        if classify::stmt_ends_with_semi(&self.node) {        // Some statements require a trailing semicolon.        ];            ast::TtToken(self.span, token::Interpolated(token::NtStmt(self.clone())))        let mut tts = vec![    fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for P<ast::Stmt> {}    }        parse_tts_from_source_str("<quote expansion>".to_string(), s, cx.cfg(), cx.parse_sess())        });            s.print_where_clause(&self)        let s = pprust::to_string(|s| {    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::WhereClause {}    }        parse_tts_from_source_str("<quote expansion>".to_string(), s, cx.cfg(), cx.parse_sess())        let s = pprust::generics_to_string(self);    fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {impl ToTokens for ast::Generics {}