remove FIXME #2888, now bug is fixed
This commit is contained in:
parent
98a6cbdba3
commit
9de40dfc87
@ -1456,16 +1456,14 @@ mod test {
|
||||
pprust::print_mod(s, &crate.module, crate.attrs);
|
||||
}
|
||||
|
||||
fn expand_and_resolve_and_pretty_print (crate_str : @str) -> ~str {
|
||||
let resolver = new_ident_resolver();
|
||||
let resolver_fold = fun_to_ident_folder(resolver);
|
||||
let (crate_ast,ps) = string_to_crate_and_sess(crate_str);
|
||||
//fn expand_and_resolve_and_pretty_print (crate_str : @str) -> ~str {
|
||||
//let (crate_ast,ps) = string_to_crate_and_sess(crate_str);
|
||||
// the cfg argument actually does matter, here...
|
||||
let expanded_ast = expand_crate(ps,~[],crate_ast);
|
||||
//let expanded_ast = expand_crate(ps,~[],crate_ast);
|
||||
// std::io::println(fmt!("expanded: %?\n",expanded_ast));
|
||||
let resolved_ast = resolver_fold.fold_crate(expanded_ast);
|
||||
pprust::to_str(&resolved_ast,fake_print_crate,get_ident_interner())
|
||||
}
|
||||
//let resolved_ast = mtwt_resolve_crate(expanded_ast);
|
||||
//pprust::to_str(&resolved_ast,fake_print_crate,get_ident_interner())
|
||||
//}
|
||||
|
||||
#[test]
|
||||
fn automatic_renaming () {
|
||||
@ -1476,16 +1474,18 @@ mod test {
|
||||
@"macro_rules! f (($x:ident) => ($x + b)) fn a() -> int { let b = 13; f!(b)}",
|
||||
// the b before the plus should not be renamed (requires marks)
|
||||
@"macro_rules! f (($x:ident) => ({let b=9; ($x + b)})) fn a() -> int { f!(b)}",
|
||||
// FIXME #6994: the next string exposes the bug referred to in issue 6994, so I'm
|
||||
// commenting it out.
|
||||
// the z flows into and out of two macros (g & f) along one path, and one (just g) along the
|
||||
// other, so the result of the whole thing should be "let z_123 = 3; z_123"
|
||||
@"macro_rules! g (($x:ident) => ({macro_rules! f(($y:ident)=>({let $y=3;$x}));f!($x)}))
|
||||
fn a(){g!(z)}"
|
||||
//@"macro_rules! g (($x:ident) => ({macro_rules! f(($y:ident)=>({let $y=3;$x}));f!($x)}))
|
||||
// fn a(){g!(z)}"
|
||||
// create a really evil test case where a $x appears inside a binding of $x but *shouldnt*
|
||||
// bind because it was inserted by a different macro....
|
||||
];
|
||||
for s in teststrs.iter() {
|
||||
// we need regexps to test these!
|
||||
std::io::println(expand_and_resolve_and_pretty_print(*s));
|
||||
//std::io::println(expand_and_resolve_and_pretty_print(*s));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -325,9 +325,8 @@ pub fn noop_fold_item_underscore(i: &item_, fld: @ast_fold) -> item_ {
|
||||
)
|
||||
}
|
||||
item_mac(ref m) => {
|
||||
// FIXME #2888: we might actually want to do something here.
|
||||
// ... okay, we're doing something. It would probably be nicer
|
||||
// to add something to the ast_fold trait, but I'll defer
|
||||
// It would probably be nicer
|
||||
// to expose this in the ast_fold trait, but I'll defer
|
||||
// that work.
|
||||
item_mac(fold_mac_(m,fld))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user