Skip to content

Commit 74be967

Browse files
committed
---
yaml --- r: 35211 b: refs/heads/master c: 57588ed h: refs/heads/master i: 35209: 2ce7970 35207: 9f42fd3 v: v3
1 parent 5ebad4c commit 74be967

File tree

6 files changed

+443
-124
lines changed

6 files changed

+443
-124
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b053f0b5e68233f664d087f06fc5ebaec2f19f97
2+
refs/heads/master: 57588edf3bc2450fd1daff4ec2565fe5edbedcef
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libsyntax/ext/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ fn syntax_expander_table() -> HashMap<~str, syntax_extension> {
100100
syntax_expanders.insert(~"deriving_eq",
101101
item_decorator(
102102
ext::deriving::expand_deriving_eq));
103+
syntax_expanders.insert(~"deriving_iter_bytes",
104+
item_decorator(
105+
ext::deriving::expand_deriving_iter_bytes));
103106

104107
// Quasi-quoting expanders
105108
syntax_expanders.insert(~"quote_tokens",

trunk/src/libsyntax/ext/build.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ fn mk_block(cx: ext_ctxt, sp: span,
141141
span: sp };
142142
mk_expr(cx, sp, ast::expr_block(blk))
143143
}
144+
fn mk_block_(cx: ext_ctxt, sp: span, +stmts: ~[@ast::stmt]) -> ast::blk {
145+
{
146+
node: {
147+
view_items: ~[],
148+
stmts: move stmts,
149+
expr: None,
150+
id: cx.next_id(),
151+
rules: ast::default_blk
152+
},
153+
span: sp
154+
}
155+
}
144156
fn mk_simple_block(cx: ext_ctxt, span: span, expr: @ast::expr) -> ast::blk {
145157
let block = {
146158
view_items: ~[],
@@ -177,4 +189,39 @@ fn mk_bool(cx: ext_ctxt, span: span, value: bool) -> @ast::expr {
177189
let lit_expr = ast::expr_lit(@{ node: ast::lit_bool(value), span: span });
178190
build::mk_expr(cx, span, move lit_expr)
179191
}
192+
fn mk_stmt(cx: ext_ctxt, span: span, expr: @ast::expr) -> @ast::stmt {
193+
let stmt_ = ast::stmt_semi(expr, cx.next_id());
194+
@{ node: move stmt_, span: span }
195+
}
196+
fn mk_ty_path(cx: ext_ctxt,
197+
span: span,
198+
idents: ~[ ast::ident ])
199+
-> @ast::Ty {
200+
let ty = build::mk_raw_path(span, idents);
201+
let ty = ast::ty_path(ty, cx.next_id());
202+
let ty = @{ id: cx.next_id(), node: move ty, span: span };
203+
ty
204+
}
205+
fn mk_simple_ty_path(cx: ext_ctxt,
206+
span: span,
207+
ident: ast::ident)
208+
-> @ast::Ty {
209+
mk_ty_path(cx, span, ~[ ident ])
210+
}
211+
fn mk_arg(cx: ext_ctxt,
212+
span: span,
213+
ident: ast::ident,
214+
ty: @ast::Ty)
215+
-> ast::arg {
216+
let arg_pat = mk_pat_ident(cx, span, ident);
217+
{
218+
mode: ast::infer(cx.next_id()),
219+
ty: ty,
220+
pat: arg_pat,
221+
id: cx.next_id()
222+
}
223+
}
224+
fn mk_fn_decl(+inputs: ~[ast::arg], output: @ast::Ty) -> ast::fn_decl {
225+
{ inputs: move inputs, output: output, cf: ast::return_val }
226+
}
180227

0 commit comments

Comments
 (0)