Change ast::path into a struct.
This commit is contained in:
@@ -34,19 +34,19 @@ mod syntax {
|
||||
}
|
||||
|
||||
fn path(ids: ~[ident], span: span) -> @ast::path {
|
||||
@{span: span,
|
||||
global: false,
|
||||
idents: ids,
|
||||
rp: None,
|
||||
types: ~[]}
|
||||
@ast::path { span: span,
|
||||
global: false,
|
||||
idents: ids,
|
||||
rp: None,
|
||||
types: ~[] }
|
||||
}
|
||||
|
||||
fn path_global(ids: ~[ident], span: span) -> @ast::path {
|
||||
@{span: span,
|
||||
global: true,
|
||||
idents: ids,
|
||||
rp: None,
|
||||
types: ~[]}
|
||||
@ast::path { span: span,
|
||||
global: true,
|
||||
idents: ids,
|
||||
rp: None,
|
||||
types: ~[] }
|
||||
}
|
||||
|
||||
trait append_types {
|
||||
@@ -56,13 +56,13 @@ trait append_types {
|
||||
|
||||
impl @ast::path: append_types {
|
||||
fn add_ty(ty: @ast::Ty) -> @ast::path {
|
||||
@{types: vec::append_one(self.types, ty),
|
||||
.. *self}
|
||||
@ast::path { types: vec::append_one(self.types, ty),
|
||||
.. *self}
|
||||
}
|
||||
|
||||
fn add_tys(+tys: ~[@ast::Ty]) -> @ast::path {
|
||||
@{types: vec::append(self.types, tys),
|
||||
.. *self}
|
||||
@ast::path { types: vec::append(self.types, tys),
|
||||
.. *self}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user