Skip to content

Commit 047b02d

Browse files
committed
More flailing on log syntax due to call-expr ambiguity in previous attempt.
1 parent 7bf12f3 commit 047b02d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/comp/syntax/parse/parser.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -910,10 +910,13 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
910910
ex = ast::expr_fail(some(e));
911911
} else { ex = ast::expr_fail(none); }
912912
} else if eat_word(p, "log_full") {
913+
expect(p, token::LPAREN);
913914
let lvl = parse_expr(p);
915+
expect(p, token::COMMA);
914916
let e = parse_expr(p);
915917
ex = ast::expr_log(2, lvl, e);
916-
hi = e.span.hi;
918+
hi = p.get_hi_pos();
919+
expect(p, token::RPAREN);
917920
} else if eat_word(p, "log") {
918921
let e = parse_expr(p);
919922
ex = ast::expr_log(1, mk_lit_u32(p, 1u32), e);

src/comp/syntax/print/pprust.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,12 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
919919
0 { word_nbsp(s, "log_err"); print_expr(s, expr); }
920920
2 {
921921
word_nbsp(s, "log_full");
922-
word(s.s, " ");
922+
popen(s);
923923
print_expr(s, lexp);
924+
word(s.s, ",");
925+
space_if_not_bol(s);
926+
print_expr(s, expr);
927+
pclose(s);
924928
}
925929
}
926930
}

0 commit comments

Comments
 (0)