Skip to content

Commit f77ea0d

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 39147 b: refs/heads/incoming c: ba354b1 h: refs/heads/master i: 39145: 92bfd5c 39143: 75b2292 v: v3
1 parent 3471a26 commit f77ea0d

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
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: b7fcc9b52e83db053633648a61b1a3f4c8ce25e6
9+
refs/heads/incoming: ba354b1726988eca0d4a0b023c1bafd576b3570b
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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)