summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-01 13:30:06 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-03-02 16:49:31 -0800
commit256afb8a1057fdbe7bca2860af1ddb6ef0768d5c (patch)
tree4d766550ef686ca96c90c71fa3679af517093827 /src/libsyntax/ext
parent97fd421319fda45d0d4c6a0906f29a228ec57b42 (diff)
downloadrust-256afb8a1057fdbe7bca2860af1ddb6ef0768d5c.tar.gz
rust-256afb8a1057fdbe7bca2860af1ddb6ef0768d5c.zip
libsyntax: Remove `fn@`, `fn~`, and `fn&` from libsyntax. rs=defun
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs24
-rw-r--r--src/libsyntax/ext/expand.rs44
-rw-r--r--src/libsyntax/ext/fmt.rs4
3 files changed, 46 insertions, 26 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 7d3c7cafa95..b3d3358e586 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -37,29 +37,39 @@ pub struct MacroDef {
     ext: SyntaxExtension
 }
 
-pub type ItemDecorator =
-    fn@(ext_ctxt, span, @ast::meta_item, ~[@ast::item]) -> ~[@ast::item];
+pub type ItemDecorator = @fn(ext_ctxt,
+                             span,
+                             @ast::meta_item,
+                             ~[@ast::item])
+                          -> ~[@ast::item];
 
 pub struct SyntaxExpanderTT {
     expander: SyntaxExpanderTTFun,
     span: Option<span>
 }
 
-pub type SyntaxExpanderTTFun
-    = fn@(ext_ctxt, span, &[ast::token_tree]) -> MacResult;
+pub type SyntaxExpanderTTFun = @fn(ext_ctxt,
+                                   span,
+                                   &[ast::token_tree])
+                                -> MacResult;
 
 pub struct SyntaxExpanderTTItem {
     expander: SyntaxExpanderTTItemFun,
     span: Option<span>
 }
 
-pub type SyntaxExpanderTTItemFun
-    = fn@(ext_ctxt, span, ast::ident, ~[ast::token_tree]) -> MacResult;
+pub type SyntaxExpanderTTItemFun = @fn(ext_ctxt,
+                                       span,
+                                       ast::ident,
+                                       ~[ast::token_tree])
+                                    -> MacResult;
 
 pub enum MacResult {
     MRExpr(@ast::expr),
     MRItem(@ast::item),
-    MRAny(fn@()-> @ast::expr, fn@()-> Option<@ast::item>, fn@()->@ast::stmt),
+    MRAny(@fn() -> @ast::expr,
+          @fn() -> Option<@ast::item>,
+          @fn() -> @ast::stmt),
     MRDef(MacroDef)
 }
 
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index e3408a47c9a..858ce4b17a3 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -26,9 +26,12 @@ use core::option;
 use core::vec;
 use core::hashmap::LinearMap;
 
-pub fn expand_expr(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
-                   e: &expr_, s: span, fld: ast_fold,
-                   orig: fn@(&expr_, span, ast_fold) -> (expr_, span))
+pub fn expand_expr(extsbox: @mut SyntaxEnv,
+                   cx: ext_ctxt,
+                   e: &expr_,
+                   s: span,
+                   fld: ast_fold,
+                   orig: @fn(&expr_, span, ast_fold) -> (expr_, span))
                 -> (expr_, span) {
     match *e {
         // expr_mac should really be expr_ext or something; it's the
@@ -105,9 +108,11 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
 //
 // NB: there is some redundancy between this and expand_item, below, and
 // they might benefit from some amount of semantic and language-UI merger.
-pub fn expand_mod_items(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
-                        module_: &ast::_mod, fld: ast_fold,
-                        orig: fn@(&ast::_mod, ast_fold) -> ast::_mod)
+pub fn expand_mod_items(extsbox: @mut SyntaxEnv,
+                        cx: ext_ctxt,
+                        module_: &ast::_mod,
+                        fld: ast_fold,
+                        orig: @fn(&ast::_mod, ast_fold) -> ast::_mod)
                      -> ast::_mod {
     // Fold the contents first:
     let module_ = orig(module_, fld);
@@ -155,8 +160,10 @@ macro_rules! with_exts_frame (
 
 // When we enter a module, record it, for the sake of `module!`
 pub fn expand_item(extsbox: @mut SyntaxEnv,
-                   cx: ext_ctxt, it: @ast::item, fld: ast_fold,
-                   orig: fn@(@ast::item, ast_fold) -> Option<@ast::item>)
+                   cx: ext_ctxt,
+                   it: @ast::item,
+                   fld: ast_fold,
+                   orig: @fn(@ast::item, ast_fold) -> Option<@ast::item>)
                 -> Option<@ast::item> {
     // need to do expansion first... it might turn out to be a module.
     let maybe_it = match it.node {
@@ -296,11 +303,13 @@ pub fn expand_item_mac(+extsbox: @mut SyntaxEnv,
 }
 
 // expand a stmt
-pub fn expand_stmt(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
-                   s: &stmt_, sp: span, fld: ast_fold,
-                   orig: fn@(s: &stmt_, span, ast_fold) -> (stmt_, span))
+pub fn expand_stmt(extsbox: @mut SyntaxEnv,
+                   cx: ext_ctxt,
+                   s: &stmt_,
+                   sp: span,
+                   fld: ast_fold,
+                   orig: @fn(&stmt_, span, ast_fold) -> (stmt_, span))
                 -> (stmt_, span) {
-
     let (mac, pth, tts, semi) = match *s {
         stmt_mac(ref mac, semi) => {
             match mac.node {
@@ -356,10 +365,13 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
 
 
 
-pub fn expand_block(extsbox: @mut SyntaxEnv, cx: ext_ctxt,
-                    blk: &blk_, sp: span, fld: ast_fold,
-                    orig: fn@(&blk_, span, ast_fold) -> (blk_, span))
-    -> (blk_, span) {
+pub fn expand_block(extsbox: @mut SyntaxEnv,
+                    cx: ext_ctxt,
+                    blk: &blk_,
+                    sp: span,
+                    fld: ast_fold,
+                    orig: @fn(&blk_, span, ast_fold) -> (blk_, span))
+                 -> (blk_, span) {
     match (*extsbox).find(&@~" block") {
         // no scope limit on macros in this block, no need
         // to push an exts frame:
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs
index c414f7a0b9c..af558e6b330 100644
--- a/src/libsyntax/ext/fmt.rs
+++ b/src/libsyntax/ext/fmt.rs
@@ -42,9 +42,7 @@ pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: &str) -> ! {
         cx.span_fatal(sp, msg);
     }
-    let parse_fmt_err = fn@(s: &str) -> ! {
-        parse_fmt_err_(cx, fmtspan, s)
-    };
+    let parse_fmt_err: @fn(&str) -> ! = |s| parse_fmt_err_(cx, fmtspan, s);
     let pieces = parse_fmt_string(fmt, parse_fmt_err);
     MRExpr(pieces_to_expr(cx, sp, pieces, args))
 }