Skip to content

Commit 1a2c6b0

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 35289 b: refs/heads/master c: ba354b1 h: refs/heads/master i: 35287: a092e61 v: v3
1 parent caa9ea8 commit 1a2c6b0

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
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: b7fcc9b52e83db053633648a61b1a3f4c8ce25e6
2+
refs/heads/master: ba354b1726988eca0d4a0b023c1bafd576b3570b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libsyntax/ext/expand.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,24 @@ fn expand_stmt(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt,
303303
304304
return (fully_expanded, sp)
305305
}
306+
307+
Some(normal({expander: exp, span: exp_sp})) => {
308+
//convert the new-style invoc for the old-style macro
309+
let arg = base::tt_args_to_original_flavor(cx, pth.span, tts);
310+
let exp_expr = exp(cx, mac.span, arg, None);
311+
let expanded = @{node: ast::stmt_expr(exp_expr, cx.next_id()),
312+
span: exp_expr.span};
313+
314+
cx.bt_push(ExpandedFrom({call_site: sp,
315+
callie: {name: *extname,
316+
span: exp_sp}}));
317+
//keep going, outside-in
318+
let fully_expanded = fld.fold_stmt(expanded).node;
319+
cx.bt_pop();
320+
321+
(fully_expanded, sp)
322+
}
323+
306324
_ => {
307325
cx.span_fatal(pth.span,
308326
fmt!("'%s' is not a tt-style macro",

0 commit comments

Comments
 (0)