diff options
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/ext/concat_idents.rs | 22 | ||||
| -rw-r--r-- | src/libsyntax/ext/log_syntax.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 30 |
5 files changed, 50 insertions, 27 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index e241f6435d3..625c04a6463 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -263,8 +263,12 @@ priv impl ext_ctxt { } fn expr(span: span, node: ast::expr_) -> @ast::expr { - @{id: self.next_id(), callee_id: self.next_id(), - node: node, span: span} + @ast::expr { + id: self.next_id(), + callee_id: self.next_id(), + node: node, + span: span, + } } fn path(span: span, strs: ~[ast::ident]) -> @ast::path { diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index cc4c58f3504..a4184bdfda7 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -19,10 +19,13 @@ use ext::build; use core::dvec; use core::option; -fn mk_expr(cx: ext_ctxt, sp: codemap::span, expr: ast::expr_) -> +fn mk_expr(cx: ext_ctxt, sp: codemap::span, expr: ast::expr_) -> @ast::expr { @ast::expr { - return @{id: cx.next_id(), callee_id: cx.next_id(), - node: expr, span: sp}; + id: cx.next_id(), + callee_id: cx.next_id(), + node: expr, + span: sp, + } } fn mk_lit(cx: ext_ctxt, sp: span, lit: ast::lit_) -> @ast::expr { diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs index 32e77afab93..8e94ed19021 100644 --- a/src/libsyntax/ext/concat_idents.rs +++ b/src/libsyntax/ext/concat_idents.rs @@ -34,13 +34,19 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: ~[ast::token_tree]) } let res = cx.parse_sess().interner.intern(@res_str); - let e = @{id: cx.next_id(), - callee_id: cx.next_id(), - node: ast::expr_path(@ast::path { span: sp, - global: false, - idents: ~[res], - rp: None, - types: ~[] }), - span: sp}; + let e = @ast::expr { + id: cx.next_id(), + callee_id: cx.next_id(), + node: ast::expr_path( + @ast::path { + span: sp, + global: false, + idents: ~[res], + rp: None, + types: ~[], + } + ), + span: sp, + }; mr_expr(e) } diff --git a/src/libsyntax/ext/log_syntax.rs b/src/libsyntax/ext/log_syntax.rs index 563c56e02b5..5308f4c3486 100644 --- a/src/libsyntax/ext/log_syntax.rs +++ b/src/libsyntax/ext/log_syntax.rs @@ -25,6 +25,10 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, tt: ~[ast::token_tree]) print::pprust::tt_to_str(ast::tt_delim(tt),cx.parse_sess().interner)); //trivial expression - return mr_expr(@{id: cx.next_id(), callee_id: cx.next_id(), - node: ast::expr_rec(~[], option::None), span: sp}); + mr_expr(@ast::expr { + id: cx.next_id(), + callee_id: cx.next_id(), + node: ast::expr_rec(~[], option::None), + span: sp, + }) } diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 19cbf833c0f..8472e61c196 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -122,17 +122,21 @@ impl ext_ctxt: ext_ctxt_ast_builder { } fn block_expr(b: ast::blk) -> @ast::expr { - @{id: self.next_id(), - callee_id: self.next_id(), - node: ast::expr_block(b), - span: dummy_sp()} + @expr { + id: self.next_id(), + callee_id: self.next_id(), + node: ast::expr_block(b), + span: dummy_sp(), + } } fn move_expr(e: @ast::expr) -> @ast::expr { - @{id: self.next_id(), - callee_id: self.next_id(), - node: ast::expr_unary_move(e), - span: e.span} + @expr { + id: self.next_id(), + callee_id: self.next_id(), + node: ast::expr_unary_move(e), + span: e.span, + } } fn stmt_expr(e: @ast::expr) -> @ast::stmt { @@ -153,10 +157,12 @@ impl ext_ctxt: ext_ctxt_ast_builder { } fn rec(+fields: ~[ast::field]) -> @ast::expr { - @{id: self.next_id(), - callee_id: self.next_id(), - node: ast::expr_rec(fields, None), - span: dummy_sp()} + @expr { + id: self.next_id(), + callee_id: self.next_id(), + node: ast::expr_rec(fields, None), + span: dummy_sp(), + } } fn ty_field_imm(name: ident, ty: @ast::Ty) -> ast::ty_field { |
