Allow extern mods to be anonymous

extern mod {
  f();
}

is now allowed, and puts f in the enclosing scope. (Requires a
link_name attribute to be really useful...)
This commit is contained in:
Tim Chevalier 2012-08-29 12:22:05 -07:00
parent cdcf5a7580
commit cb8ecd7984
8 changed files with 54 additions and 20 deletions

View file

@ -469,7 +469,10 @@ fn print_item(s: ps, &&item: @ast::item) {
ast::item_foreign_mod(nmod) => {
head(s, ~"extern");
word_nbsp(s, ~"mod");
print_ident(s, item.ident);
match nmod.sort {
ast::named => print_ident(s, item.ident),
ast::anonymous => {}
}
nbsp(s);
bopen(s);
print_foreign_mod(s, nmod, item.attrs);