Fix buggy while and do-while translation in rustc. Add test.

This commit is contained in:
Graydon Hoare 2010-11-04 07:55:33 -07:00
parent 896570a3a9
commit 16faef2218
4 changed files with 35 additions and 12 deletions

View file

@ -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));
}