diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-01-13 13:13:41 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-01-14 18:15:53 -0800 |
| commit | 530a113bfa2702b415e38f3168d5c95ee1d93718 (patch) | |
| tree | 042a0580b8982f8d466cb975a1aae75ac88436c9 /src/libsyntax/ext | |
| parent | ebea895d026722e5887bd6544639152b87a80cc5 (diff) | |
| download | rust-530a113bfa2702b415e38f3168d5c95ee1d93718.tar.gz rust-530a113bfa2702b415e38f3168d5c95ee1d93718.zip | |
convert ast::item into a struct
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 12 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index a80a56fe4f1..35b5f4be9a4 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -121,8 +121,10 @@ fn expand_auto_encode( } fn filter_attrs(item: @ast::item) -> @ast::item { - @{attrs: item.attrs.filtered(|a| !is_auto_encode(a)), - .. *item} + @ast::item { + attrs: item.attrs.filtered(|a| !is_auto_encode(a)), + .. *item + } } do vec::flat_map(in_items) |item| { @@ -185,8 +187,10 @@ fn expand_auto_decode( } fn filter_attrs(item: @ast::item) -> @ast::item { - @{attrs: item.attrs.filtered(|a| !is_auto_decode(a)), - .. *item} + @ast::item { + attrs: item.attrs.filtered(|a| !is_auto_decode(a)), + .. *item + } } do vec::flat_map(in_items) |item| { @@ -444,7 +448,7 @@ fn mk_impl( tps.map(|tp| cx.ty_path(span, ~[tp.ident], ~[])) ); - @{ + @ast::item { // This is a new-style impl declaration. // XXX: clownshoes ident: parse::token::special_idents::clownshoes_extensions, diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs index 392b4068880..5b98868cd04 100644 --- a/src/libsyntax/ext/deriving.rs +++ b/src/libsyntax/ext/deriving.rs @@ -111,7 +111,7 @@ fn expand_deriving(cx: ext_ctxt, } fn create_impl_item(cx: ext_ctxt, span: span, +item: item_) -> @item { - @{ + @ast::item { ident: clownshoes_extensions, attrs: ~[], id: cx.next_id(), diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index a6063b033cb..3bec9c6ea99 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -229,12 +229,12 @@ impl ext_ctxt: ext_ctxt_ast_builder { is_sugared_doc: false }); - @{ident: name, - attrs: ~[non_camel_case_attribute], - id: self.next_id(), - node: node, - vis: ast::public, - span: span} + @ast::item { ident: name, + attrs: ~[non_camel_case_attribute], + id: self.next_id(), + node: node, + vis: ast::public, + span: span } } fn item_fn_poly(name: ident, |
