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

@@ -55,17 +55,17 @@ pub trait Folder {
let id = self.new_id(node_id);
ViewPathList(self.fold_path(path),
path_list_idents.iter().map(|path_list_ident| {
let id = self.new_id(path_list_ident.node
.id);
Spanned {
node: PathListIdent_ {
name: path_list_ident.node
.name
.clone(),
id: id,
node: match path_list_ident.node {
PathListIdent { id, name } =>
PathListIdent {
id: self.new_id(id),
name: name.clone()
},
PathListMod { id } =>
PathListMod { id: self.new_id(id) }
},
span: self.new_span(
path_list_ident.span)
span: self.new_span(path_list_ident.span)
}
}).collect(),
id)