diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-12-21 14:31:31 -0800 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-12-21 14:31:31 -0800 |
| commit | 8d9e7deab5fd509160d60c33f2c7fb83acde9366 (patch) | |
| tree | f4c2c91b66c07c90ab3d855d3f4cc687cd63eb98 /src/comp/syntax/print/pprust.rs | |
| parent | 66856a39b38b1ded0200e57c713c39ecf3dcc192 (diff) | |
Switch log_expr to carrying a full expr:u32 for level. Add log_full variant that parses that expr, prepare for snapshot.
Diffstat (limited to 'src/comp/syntax/print/pprust.rs')
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 4ac884171b3..eef84757b8a 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -913,9 +913,16 @@ fn print_expr(s: ps, &&expr: @ast::expr) { } } ast::expr_be(result) { word_nbsp(s, "be"); print_expr(s, result); } - ast::expr_log(lvl, expr) { - alt lvl { 1 { word_nbsp(s, "log"); } 0 { word_nbsp(s, "log_err"); } } - print_expr(s, expr); + ast::expr_log(lvl, lexp, expr) { + alt lvl { + 1 { word_nbsp(s, "log"); print_expr(s, expr); } + 0 { word_nbsp(s, "log_err"); print_expr(s, expr); } + 2 { + word_nbsp(s, "log_full"); + word(s.s, " "); + print_expr(s, lexp); + } + } } ast::expr_check(m, expr) { alt m { @@ -990,7 +997,7 @@ fn print_expr_parens_if_not_bot(s: ps, ex: @ast::expr) { ast::expr_ternary(_, _, _) | ast::expr_move(_, _) | ast::expr_copy(_) | ast::expr_assign(_, _) | ast::expr_be(_) | ast::expr_assign_op(_, _, _) | ast::expr_swap(_, _) | - ast::expr_log(_, _) | ast::expr_assert(_) | + ast::expr_log(_, _, _) | ast::expr_assert(_) | ast::expr_check(_, _) { true } _ { false } }; @@ -1305,7 +1312,7 @@ fn need_parens(expr: @ast::expr, outer_prec: int) -> bool { ast::expr_be(_) { true } ast::expr_assert(_) { true } ast::expr_check(_, _) { true } - ast::expr_log(_, _) { true } + ast::expr_log(_, _, _) { true } _ { false } } } @@ -1644,7 +1651,7 @@ fn ends_in_lit_int(ex: @ast::expr) -> bool { ast::expr_ternary(_, _, sub) | ast::expr_move(_, sub) | ast::expr_copy(sub) | ast::expr_assign(_, sub) | ast::expr_be(sub) | ast::expr_assign_op(_, _, sub) | ast::expr_swap(_, sub) | - ast::expr_log(_, sub) | ast::expr_assert(sub) | + ast::expr_log(_, _, sub) | ast::expr_assert(sub) | ast::expr_check(_, sub) { ends_in_lit_int(sub) } ast::expr_fail(osub) | ast::expr_ret(osub) { alt osub { |
