use abi::Abi;
use ast::{self, Ident, Generics, Expr, BlockCheckMode, UnOp, PatKind};
use attr;
-use codemap::{Span, respan, Spanned, DUMMY_SP, Pos};
+use syntax_pos::{Span, DUMMY_SP, Pos};
+use codemap::{respan, Spanned};
use ext::base::ExtCtxt;
use parse::token::{self, keywords, InternedString};
use ptr::P;
}
fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt {
- respan(expr.span, ast::StmtKind::Expr(expr, ast::DUMMY_NODE_ID))
+ ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
+ span: expr.span,
+ node: ast::StmtKind::Expr(expr),
+ }
}
fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt {
- respan(expr.span, ast::StmtKind::Semi(expr, ast::DUMMY_NODE_ID))
+ ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
+ span: expr.span,
+ node: ast::StmtKind::Semi(expr),
+ }
}
fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
init: Some(ex),
id: ast::DUMMY_NODE_ID,
span: sp,
- attrs: None,
+ attrs: ast::ThinVec::new(),
});
- let decl = respan(sp, ast::DeclKind::Local(local));
- respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))
+ ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
+ node: ast::StmtKind::Local(local),
+ span: sp,
+ }
}
fn stmt_let_typed(&self,
init: Some(ex),
id: ast::DUMMY_NODE_ID,
span: sp,
- attrs: None,
+ attrs: ast::ThinVec::new(),
});
- let decl = respan(sp, ast::DeclKind::Local(local));
- P(respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID)))
+ P(ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
+ node: ast::StmtKind::Local(local),
+ span: sp,
+ })
}
fn stmt_item(&self, sp: Span, item: P<ast::Item>) -> ast::Stmt {
- let decl = respan(sp, ast::DeclKind::Item(item));
- respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))
+ ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
+ node: ast::StmtKind::Item(item),
+ span: sp,
+ }
}
fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block> {
- self.block(expr.span, vec![Spanned {
+ self.block(expr.span, vec![ast::Stmt {
+ id: ast::DUMMY_NODE_ID,
span: expr.span,
- node: ast::StmtKind::Expr(expr, ast::DUMMY_NODE_ID),
+ node: ast::StmtKind::Expr(expr),
}])
}
fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block> {
id: ast::DUMMY_NODE_ID,
node: node,
span: span,
- attrs: None,
+ attrs: ast::ThinVec::new(),
})
}
}
fn pat_enum(&self, span: Span, path: ast::Path, subpats: Vec<P<ast::Pat>>) -> P<ast::Pat> {
let pat = if subpats.is_empty() {
- PatKind::Path(path)
+ PatKind::Path(None, path)
} else {
PatKind::TupleStruct(path, subpats, None)
};