1
Fork 0

convert ast::blk_ into a struct

This commit is contained in:
Erick Tryzelaar 2013-01-14 19:35:08 -08:00
parent 0b9e23146b
commit 3ea3136e84
8 changed files with 108 additions and 65 deletions

View file

@ -356,21 +356,29 @@ priv impl ext_ctxt {
}
fn blk(span: span, stmts: ~[@ast::stmt]) -> ast::blk {
ast::spanned { node: { view_items: ~[],
stmts: stmts,
expr: None,
id: self.next_id(),
rules: ast::default_blk},
span: span }
ast::spanned {
node: ast::blk_ {
view_items: ~[],
stmts: stmts,
expr: None,
id: self.next_id(),
rules: ast::default_blk,
},
span: span,
}
}
fn expr_blk(expr: @ast::expr) -> ast::blk {
ast::spanned { node: { view_items: ~[],
stmts: ~[],
expr: Some(expr),
id: self.next_id(),
rules: ast::default_blk},
span: expr.span }
ast::spanned {
node: ast::blk_ {
view_items: ~[],
stmts: ~[],
expr: Some(expr),
id: self.next_id(),
rules: ast::default_blk,
},
span: expr.span,
}
}
fn expr_path(span: span, strs: ~[ast::ident]) -> @ast::expr {