Fix buggy while and do-while translation in rustc. Add test.
This commit is contained in:
parent
896570a3a9
commit
16faef2218
4 changed files with 35 additions and 12 deletions
|
|
@ -636,6 +636,7 @@ impure fn parse_do_while_expr(parser p) -> @ast.expr {
|
|||
expect (p, token.LPAREN);
|
||||
auto cond = parse_expr(p);
|
||||
expect(p, token.RPAREN);
|
||||
expect(p, token.SEMI);
|
||||
hi = cond.span;
|
||||
ret @spanned(lo, hi, ast.expr_do_while(body, cond, ast.ann_none));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue