diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-08-21 21:44:41 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-08-22 10:44:04 -0700 |
| commit | 152cbaade7bc2ec36546554eb2d2090a9833bfff (patch) | |
| tree | d6bb39fcdcce9f67cc97f97a6259e85cbf315650 /src/comp/syntax/print | |
| parent | a3affaa20fcd718080951d5be2da3f578c960664 (diff) | |
| download | rust-152cbaade7bc2ec36546554eb2d2090a9833bfff.tar.gz rust-152cbaade7bc2ec36546554eb2d2090a9833bfff.zip | |
Move functions from syntax::ast to syntax::ast_util
This leaves syntax::ast just defining the AST, which strikes me as somewhat nicer
Diffstat (limited to 'src/comp/syntax/print')
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 8ecbfd58405..f0848fbdce5 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -9,6 +9,7 @@ import parse::lexer; import syntax::codemap::codemap; import syntax::visit; import ast; +import ast_util; import option::some; import option::none; import pp::printer; @@ -271,7 +272,7 @@ fn print_type(s: &ps, ty: &@ast::ty) { ast::ty_int. { word(s.s, "int"); } ast::ty_uint. { word(s.s, "uint"); } ast::ty_float. { word(s.s, "float"); } - ast::ty_machine(tm) { word(s.s, ast::ty_mach_to_str(tm)); } + ast::ty_machine(tm) { word(s.s, ast_util::ty_mach_to_str(tm)); } ast::ty_char. { word(s.s, "char"); } ast::ty_str. { word(s.s, "str"); } ast::ty_istr. { word(s.s, "istr"); } @@ -831,11 +832,11 @@ fn print_expr(s: &ps, expr: &@ast::expr) { let prec = operator_prec(op); print_maybe_parens(s, lhs, prec); space(s.s); - word_space(s, ast::binop_to_str(op)); + word_space(s, ast_util::binop_to_str(op)); print_maybe_parens(s, rhs, prec + 1); } ast::expr_unary(op, expr) { - word(s.s, ast::unop_to_str(op)); + word(s.s, ast_util::unop_to_str(op)); print_maybe_parens(s, expr, parse::parser::unop_prec); } ast::expr_lit(lit) { print_literal(s, lit); } @@ -967,7 +968,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) { ast::expr_assign_op(op, lhs, rhs) { print_expr(s, lhs); space(s.s); - word(s.s, ast::binop_to_str(op)); + word(s.s, ast_util::binop_to_str(op)); word_space(s, "="); print_expr(s, rhs); } @@ -1486,12 +1487,12 @@ fn print_literal(s: &ps, lit: &@ast::lit) { ast::lit_float(fstr) { word(s.s, fstr); } ast::lit_mach_int(mach, val) { word(s.s, int::str(val as int)); - word(s.s, ast::ty_mach_to_str(mach)); + word(s.s, ast_util::ty_mach_to_str(mach)); } ast::lit_mach_float(mach, val) { // val is already a str word(s.s, val); - word(s.s, ast::ty_mach_to_str(mach)); + word(s.s, ast_util::ty_mach_to_str(mach)); } ast::lit_nil. { word(s.s, "()"); } ast::lit_bool(val) { |
