Change ast::path into a struct.

This commit is contained in:
Erick Tryzelaar
2013-01-13 10:48:09 -08:00
parent 1be4bfb8cc
commit bea67bde21
12 changed files with 144 additions and 71 deletions

View File

@@ -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}
}
}