Skip to content

Commit

Permalink
remove FIXME rust-lang#2888, now bug is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclements committed Jul 28, 2013
1 parent 03be3c8 commit e00fd37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use ext::base::*;
use fold::*;
use parse;
use parse::{parse_item_from_source_str};
use parse::token::{fresh_name, ident_to_str, intern};
use parse::token::{fresh_mark, fresh_name, ident_to_str, intern};
use visit;
use visit::Visitor;

Expand Down Expand Up @@ -1026,16 +1026,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 () {
Expand All @@ -1046,16 +1044,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 teststrs.iter().advance |s| {
// 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));
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/libsyntax/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,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))
}
Expand Down

0 comments on commit e00fd37

Please sign in to comment.