More flailing on log syntax due to call-expr ambiguity in previous attempt.
This commit is contained in:
parent
7bf12f3723
commit
047b02d5bc
@ -910,10 +910,13 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
|
||||
ex = ast::expr_fail(some(e));
|
||||
} else { ex = ast::expr_fail(none); }
|
||||
} else if eat_word(p, "log_full") {
|
||||
expect(p, token::LPAREN);
|
||||
let lvl = parse_expr(p);
|
||||
expect(p, token::COMMA);
|
||||
let e = parse_expr(p);
|
||||
ex = ast::expr_log(2, lvl, e);
|
||||
hi = e.span.hi;
|
||||
hi = p.get_hi_pos();
|
||||
expect(p, token::RPAREN);
|
||||
} else if eat_word(p, "log") {
|
||||
let e = parse_expr(p);
|
||||
ex = ast::expr_log(1, mk_lit_u32(p, 1u32), e);
|
||||
|
@ -919,8 +919,12 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
|
||||
0 { word_nbsp(s, "log_err"); print_expr(s, expr); }
|
||||
2 {
|
||||
word_nbsp(s, "log_full");
|
||||
word(s.s, " ");
|
||||
popen(s);
|
||||
print_expr(s, lexp);
|
||||
word(s.s, ",");
|
||||
space_if_not_bol(s);
|
||||
print_expr(s, expr);
|
||||
pclose(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user