use ast::{RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
use ast::Attribute;
use attr::ThinAttributesExt;
-use ast_util;
use util::parser::AssocOp;
use attr;
use owned_slice::OwnedSlice;
match t {
ast::SignedIntLit(st, ast::Plus) => {
word(self.writer(),
- &ast_util::int_val_to_string(st, i as i64))
+ &st.val_to_string(i as i64))
}
ast::SignedIntLit(st, ast::Minus) => {
- let istr = ast_util::int_val_to_string(st, -(i as i64));
+ let istr = st.val_to_string(-(i as i64));
word(self.writer(),
&format!("-{}", istr))
}
ast::UnsignedIntLit(ut) => {
- word(self.writer(), &ast_util::uint_val_to_string(ut, i))
+ word(self.writer(), &ut.val_to_string(i))
}
ast::UnsuffixedIntLit(ast::Plus) => {
word(self.writer(), &format!("{}", i))
&format!(
"{}{}",
&f,
- &ast_util::float_ty_to_string(t)))
+ t.ty_to_string()))
}
ast::LitFloatUnsuffixed(ref f) => word(self.writer(), &f[..]),
ast::LitBool(val) => {
pub fn print_variant(&mut self, v: &ast::Variant) -> io::Result<()> {
try!(self.head(""));
- let generics = ast_util::empty_generics();
+ let generics = ast::Generics::default();
try!(self.print_struct(&v.node.data, &generics, v.node.name, v.span, false));
match v.node.disr_expr {
Some(ref d) => {
try!(self.print_expr(lhs));
}
try!(space(&mut self.s));
- try!(self.word_space(ast_util::binop_to_string(op.node)));
+ try!(self.word_space(op.node.to_string()));
if self.check_expr_bin_needs_paren(rhs, op) {
self.print_expr_maybe_paren(rhs)
} else {
fn print_expr_unary(&mut self,
op: ast::UnOp,
expr: &ast::Expr) -> io::Result<()> {
- try!(word(&mut self.s, ast_util::unop_to_string(op)));
+ try!(word(&mut self.s, ast::UnOp::to_string(op)));
self.print_expr_maybe_paren(expr)
}
ast::ExprAssignOp(op, ref lhs, ref rhs) => {
try!(self.print_expr(&**lhs));
try!(space(&mut self.s));
- try!(word(&mut self.s, ast_util::binop_to_string(op.node)));
+ try!(word(&mut self.s, op.node.to_string()));
try!(self.word_space("="));
try!(self.print_expr(&**rhs));
}
output: ast::DefaultReturn(codemap::DUMMY_SP),
variadic: false
};
- let generics = ast_util::empty_generics();
+ let generics = ast::Generics::default();
assert_eq!(fun_to_string(&decl, ast::Unsafety::Normal,
ast::Constness::NotConst,
abba_ident,