rustc: Change lots of AST nodes to use interior vectors
This commit is contained in:
parent
bbcbaa6601
commit
0e2fff5337
23 changed files with 400 additions and 373 deletions
|
|
@ -82,8 +82,8 @@ fn filter_stmt(&ast::crate_cfg cfg,
|
|||
fn fold_block(&ast::crate_cfg cfg, &ast::block_ b,
|
||||
fold::ast_fold fld) -> ast::block_ {
|
||||
auto filter = bind filter_stmt(cfg, _);
|
||||
auto filtered_stmts = vec::filter_map(filter, b.stmts);
|
||||
ret rec(stmts=vec::map(fld.fold_stmt, filtered_stmts),
|
||||
auto filtered_stmts = ivec::filter_map(filter, b.stmts);
|
||||
ret rec(stmts=ivec::map(fld.fold_stmt, filtered_stmts),
|
||||
expr=option::map(fld.fold_expr, b.expr),
|
||||
id=b.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ fn mk_main(&test_ctxt cx) -> @ast::item {
|
|||
auto ret_ty = @rec(node=ast::ty_nil,
|
||||
span=rec(lo=0u, hi=0u));
|
||||
|
||||
let ast::fn_decl decl = rec(inputs = [],
|
||||
let ast::fn_decl decl = rec(inputs = ~[],
|
||||
output = ret_ty,
|
||||
purity = ast::impure_fn,
|
||||
cf = ast::return,
|
||||
constraints = ~[]);
|
||||
auto proto = ast::proto_fn;
|
||||
|
||||
let ast::block_ body_ = rec(stmts = [],
|
||||
let ast::block_ body_ = rec(stmts = ~[],
|
||||
expr = option::none,
|
||||
id = cx.next_node_id());
|
||||
auto body = rec(node = body_, span = rec(lo=0u, hi=0u));
|
||||
|
|
@ -87,7 +87,7 @@ fn mk_main(&test_ctxt cx) -> @ast::item {
|
|||
proto = proto,
|
||||
body = body);
|
||||
|
||||
auto item_ = ast::item_fn(fn_, []);
|
||||
auto item_ = ast::item_fn(fn_, ~[]);
|
||||
let ast::item item = rec(ident = "main",
|
||||
attrs = ~[],
|
||||
id = cx.next_node_id(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue