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

@ -76,7 +76,7 @@ fn inject_libcore_ref(sess: Session,
fold_mod: |module, fld| {
let n2 = sess.next_node_id();
let prelude_path = @{
let prelude_path = @ast::path {
span: dummy_sp(),
global: false,
idents: ~[

View file

@ -244,11 +244,19 @@ fn nospan<T: Copy>(t: T) -> ast::spanned<T> {
}
fn path_node(+ids: ~[ast::ident]) -> @ast::path {
@{span: dummy_sp(), global: false, idents: ids, rp: None, types: ~[]}
@ast::path { span: dummy_sp(),
global: false,
idents: ids,
rp: None,
types: ~[] }
}
fn path_node_global(+ids: ~[ast::ident]) -> @ast::path {
@{span: dummy_sp(), global: true, idents: ids, rp: None, types: ~[]}
@ast::path { span: dummy_sp(),
global: true,
idents: ids,
rp: None,
types: ~[] }
}
fn mk_std(cx: test_ctxt) -> @ast::view_item {

View file

@ -101,9 +101,11 @@ fn parse_path(st: @pstate) -> @ast::path {
':' => { next(st); next(st); }
c => {
if c == '(' {
return @{span: ast_util::dummy_sp(),
global: false, idents: idents,
rp: None, types: ~[]};
return @ast::path { span: ast_util::dummy_sp(),
global: false,
idents: idents,
rp: None,
types: ~[] };
} else { idents.push(parse_ident_(st, is_last)); }
}
}