Implement new mod import sugar

Implements RFC #168.
This commit is contained in:
Jakub Wieczorek
2014-07-18 00:56:56 +02:00
parent 50481f5503
commit 4b9bc2e8f2
17 changed files with 268 additions and 80 deletions

View File

@@ -2182,7 +2182,14 @@ impl<'a> State<'a> {
try!(word(&mut self.s, "::{"));
}
try!(self.commasep(Inconsistent, idents.as_slice(), |s, w| {
s.print_ident(w.node.name)
match w.node {
ast::PathListIdent { name, .. } => {
s.print_ident(name)
},
ast::PathListMod { .. } => {
word(&mut s.s, "mod")
}
}
}));
word(&mut self.s, "}")
}