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

@@ -554,7 +554,8 @@ fn noop_fold_mod(m: _mod, fld: ast_fold) -> _mod {
}
fn noop_fold_foreign_mod(nm: foreign_mod, fld: ast_fold) -> foreign_mod {
return {view_items: vec::map(nm.view_items, |x| fld.fold_view_item(x)),
return {sort: nm.sort,
view_items: vec::map(nm.view_items, |x| fld.fold_view_item(x)),
items: vec::map(nm.items, |x| fld.fold_foreign_item(x))}
}