Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb

Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
This commit is contained in:
Jeffrey Seyfried
2016-06-26 02:16:55 +00:00
23 changed files with 331 additions and 409 deletions

View File

@@ -221,10 +221,11 @@ impl<F> IdentMacroExpander for F
// Use a macro because forwarding to a simple function has type system issues
macro_rules! make_stmts_default {
($me:expr) => {
$me.make_expr().map(|e| {
SmallVector::one(codemap::respan(
e.span, ast::StmtKind::Expr(e, ast::DUMMY_NODE_ID)))
})
$me.make_expr().map(|e| SmallVector::one(ast::Stmt {
id: ast::DUMMY_NODE_ID,
span: e.span,
node: ast::StmtKind::Expr(e),
}))
}
}
@@ -436,10 +437,11 @@ impl MacResult for DummyResult {
}
fn make_stmts(self: Box<DummyResult>) -> Option<SmallVector<ast::Stmt>> {
Some(SmallVector::one(
codemap::respan(self.span,
ast::StmtKind::Expr(DummyResult::raw_expr(self.span),
ast::DUMMY_NODE_ID))))
Some(SmallVector::one(ast::Stmt {
id: ast::DUMMY_NODE_ID,
node: ast::StmtKind::Expr(DummyResult::raw_expr(self.span)),
span: self.span,
}))
}
}