diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-08-29 12:22:05 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-08-29 12:22:05 -0700 |
| commit | cb8ecd79849160d8cff2eff8b070efd7f9a3b9a7 (patch) | |
| tree | 8dd4917d09b01017532ed6c8037c5bf5cc88cd56 /src/libsyntax/print | |
| parent | cdcf5a7580147a58ecbe06323ad7c267f2e5ae28 (diff) | |
| download | rust-cb8ecd79849160d8cff2eff8b070efd7f9a3b9a7.tar.gz rust-cb8ecd79849160d8cff2eff8b070efd7f9a3b9a7.zip | |
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...)
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 3465ca20565..f24226d9edc 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -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); |
