diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-03-01 07:01:48 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-03-01 07:01:48 -0800 |
| commit | 85fecd0ba77066e604cec9d3866b76edc626b5d3 (patch) | |
| tree | a375b9e61af4c5e105b58271c9381fdaf58d31b0 /src/libsyntax/ext | |
| parent | d2c4b6492dbccc1bb60f163ac583467bc63abce6 (diff) | |
| parent | a660bb362ce5a39014fb274367e6361d4deb8a7d (diff) | |
| download | rust-85fecd0ba77066e604cec9d3866b76edc626b5d3.tar.gz rust-85fecd0ba77066e604cec9d3866b76edc626b5d3.zip | |
Merge remote-tracking branch 'remotes/origin/incoming' into incoming
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/ext/concat_idents.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/env.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 13 | ||||
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/log_syntax.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 2 |
14 files changed, 44 insertions, 21 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index 973b2ae2066..8cebe3cd187 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -93,6 +93,7 @@ use core::prelude::*; use ast; use ast_util; use attr; +use codemap; use codemap::span; use ext::base::*; use parse; @@ -1310,7 +1311,7 @@ mod test { } - fn to_call_log (val: Encodable<TestEncoder>) -> ~[call] { + fn to_call_log<E:Encodable<TestEncoder>>(val: E) -> ~[call] { let mut te = TestEncoder {call_log: @mut ~[]}; val.encode(&te); copy *te.call_log @@ -1323,8 +1324,7 @@ mod test { } #[test] fn encode_enum_test () { - check_equal (to_call_log(Book(34,44) - as Encodable::<TestEncoder>), + check_equal (to_call_log(Book(34,44)), ~[CallToEmitEnum (~"Written"), CallToEmitEnumVariant (~"Book",0,2), CallToEmitEnumVariantArg (0), @@ -1339,8 +1339,7 @@ mod test { pub struct HasPos { pos : BPos } #[test] fn encode_newtype_test () { - check_equal (to_call_log (HasPos {pos:BPos(48)} - as Encodable::<TestEncoder>), + check_equal (to_call_log (HasPos {pos:BPos(48)}), ~[CallToEmitStruct(~"HasPos",1), CallToEmitField(~"pos",0), CallToEmitUint(48)]); diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index f5a7bbddf99..7d3c7cafa95 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -82,7 +82,7 @@ pub enum SyntaxExtension { IdentTT(SyntaxExpanderTTItem), } -type SyntaxEnv = @mut MapChain<Name, Transformer>; +pub type SyntaxEnv = @mut MapChain<Name, Transformer>; // Name : the domain of SyntaxEnvs // want to change these to uints.... @@ -98,7 +98,7 @@ type Name = @~str; // toward a more uniform syntax syntax (sorry) where blocks are just // another kind of transformer. -enum Transformer { +pub enum Transformer { // this identifier maps to a syntax extension or macro SE(SyntaxExtension), // should blocks occurring here limit macro scopes? @@ -494,6 +494,7 @@ mod test { use super::*; use super::MapChain; use util::testing::check_equal; + use core::hashmap::linear::LinearMap; #[test] fn testenv () { let mut a = LinearMap::new(); diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs index d4104c3a14a..4f53bf62efb 100644 --- a/src/libsyntax/ext/concat_idents.rs +++ b/src/libsyntax/ext/concat_idents.rs @@ -10,8 +10,11 @@ use core::prelude::*; +use ast; +use codemap::span; use ext::base::*; use ext::base; +use parse::token; pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree]) -> base::MacResult { diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs index fc603cdee98..50047d2ce41 100644 --- a/src/libsyntax/ext/deriving.rs +++ b/src/libsyntax/ext/deriving.rs @@ -38,7 +38,7 @@ enum Junction { Disjunction, } -impl Junction { +pub impl Junction { fn to_binop(self) -> binop { match self { Conjunction => and, diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs index 030e819ca3f..91a9de9c051 100644 --- a/src/libsyntax/ext/env.rs +++ b/src/libsyntax/ext/env.rs @@ -15,13 +15,14 @@ * interface. */ +use prelude::*; + +use ast; +use codemap::span; use ext::base::*; use ext::base; use ext::build::mk_uniq_str; -use core::option; -use core::os; - pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree]) -> base::MacResult { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 105b65c35c9..e3408a47c9a 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -10,13 +10,16 @@ use core::prelude::*; +use ast::{blk_, attribute_, attr_outer, meta_word}; use ast::{crate, expr_, expr_mac, mac_invoc_tt}; use ast::{tt_delim, tt_tok, item_mac, stmt_, stmt_mac, stmt_expr, stmt_semi}; use ast; use attr; -use codemap::{span, CallInfo, ExpandedFrom, NameAndSpan}; +use codemap; +use codemap::{span, CallInfo, ExpandedFrom, NameAndSpan, spanned}; use ext::base::*; use fold::*; +use parse; use parse::{parser, parse_item_from_source_str, new_parser_from_tts}; use core::option; @@ -184,7 +187,7 @@ pub fn expand_item(extsbox: @mut SyntaxEnv, } // does this attribute list contain "macro_escape" ? -fn contains_macro_escape (attrs: &[ast::attribute]) -> bool{ +pub fn contains_macro_escape (attrs: &[ast::attribute]) -> bool{ let mut accum = false; do attrs.each |attr| { let mname = attr::get_attr_name(attr); @@ -490,7 +493,13 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess, #[cfg(test)] mod test { use super::*; + use ast; + use ast::{attribute_, attr_outer, meta_word}; + use codemap; + use codemap::spanned; + use parse; use util::testing::check_equal; + use core::option::{None, Some}; // make sure that fail! is present #[test] fn fail_exists_test () { diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 2169e8f6f2f..35b11962524 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -22,6 +22,7 @@ use ast; use codemap::span; use ext::base::*; use ext::base; +use ext::build; use ext::build::*; use private::extfmt::ct::*; diff --git a/src/libsyntax/ext/log_syntax.rs b/src/libsyntax/ext/log_syntax.rs index a59e43b1c1a..368520acd2d 100644 --- a/src/libsyntax/ext/log_syntax.rs +++ b/src/libsyntax/ext/log_syntax.rs @@ -8,15 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use prelude::*; +use core::io::WriterUtil; + use ast; use codemap; use ext::base::*; use ext::base; use print; -use core::io::WriterUtil; -use core::option; - pub fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, tt: &[ast::token_tree]) diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 973a4f0a4f0..40d0e2c5db2 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -20,7 +20,7 @@ use ast; use ast_util::{ident_to_path}; use ast_util; use attr; -use codemap::{span, respan, dummy_sp}; +use codemap::{span, respan, dummy_sp, spanned}; use codemap; use ext::base::{ext_ctxt, mk_ctxt}; use ext::quote::rt::*; diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index bdcdf61fc58..a5ca24c6737 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -10,7 +10,9 @@ // Parsing pipes protocols from token trees. +use ast_util; use ext::pipes::pipec::*; +use ext::pipes::proto::*; use parse::common::SeqSep; use parse::parser; use parse::token; diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 7b0f6c1529c..968a0e5f77e 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -10,8 +10,9 @@ // A protocol compiler for Rust. +use ast; use ast::ident; -use codemap::dummy_sp; +use codemap::{dummy_sp, spanned}; use ext::base::ext_ctxt; use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path}; use ext::pipes::ast_builder::{path_global}; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index e09d7555005..4349ffaea43 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -34,10 +34,12 @@ use core::str; pub mod rt { use ast; + use codemap; use ext::base::ext_ctxt; use parse; use print::pprust; + use core::prelude::*; use core::str; pub use ast::*; @@ -49,7 +51,7 @@ pub mod rt { use print::pprust; use print::pprust::{item_to_str, ty_to_str}; - trait ToTokens { + pub trait ToTokens { pub fn to_tokens(&self, _cx: ext_ctxt) -> ~[token_tree]; } @@ -73,7 +75,7 @@ pub mod rt { */ - trait ToSource { + pub trait ToSource { // Takes a thing and generates a string containing rust code for it. pub fn to_source(&self, cx: ext_ctxt) -> ~str; } @@ -164,7 +166,7 @@ pub mod rt { } } - trait ExtParseUtils { + pub trait ExtParseUtils { fn parse_item(s: ~str) -> @ast::item; fn parse_expr(s: ~str) -> @ast::expr; fn parse_stmt(s: ~str) -> @ast::stmt; diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index f9eb2d7e0af..296305bb62e 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -8,12 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use ast; use codemap; use codemap::{FileMap, Loc, Pos, ExpandedFrom, span}; use codemap::{CallInfo, NameAndSpan}; use ext::base::*; use ext::base; use ext::build::{mk_base_vec_e, mk_uint, mk_u8, mk_base_str}; +use parse; use print::pprust; use core::io; diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 419c051ea97..fae9e1651d3 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -9,6 +9,7 @@ // except according to those terms. // Earley-like parser for macros. +use ast; use ast::{matcher, match_tok, match_seq, match_nonterminal, ident}; use codemap::{BytePos, mk_sp}; use codemap; @@ -23,6 +24,7 @@ use core::dvec::DVec; use core::dvec; use core::io; use core::option; +use core::option::{Option, Some, None}; use core::str; use core::uint; use core::vec; |
