Add ecx.stmt_semi()
and fix issues with the pretty-printer
This commit is contained in:
parent
060a84d1f7
commit
8cad25199a
3 changed files with 18 additions and 3 deletions
|
@ -87,6 +87,7 @@ pub trait AstBuilder {
|
|||
|
||||
// statements
|
||||
fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt;
|
||||
fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt;
|
||||
fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident, ex: P<ast::Expr>) -> ast::Stmt;
|
||||
fn stmt_let_typed(&self,
|
||||
sp: Span,
|
||||
|
@ -507,6 +508,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
respan(expr.span, ast::StmtKind::Expr(expr, ast::DUMMY_NODE_ID))
|
||||
}
|
||||
|
||||
fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt {
|
||||
respan(expr.span, ast::StmtKind::Semi(expr, ast::DUMMY_NODE_ID))
|
||||
}
|
||||
|
||||
fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
|
||||
ex: P<ast::Expr>) -> ast::Stmt {
|
||||
let pat = if mutbl {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue