syntax: implement foreach .. in .. { .. } via desugaring.
This commit is contained in:
parent
9a2d183d6a
commit
c29e9fb60b
17 changed files with 215 additions and 3 deletions
|
@ -1228,6 +1228,14 @@ pub fn print_expr(s: @ps, expr: &ast::expr) {
|
|||
space(s.s);
|
||||
print_block(s, blk);
|
||||
}
|
||||
ast::expr_for_loop(pat, iter, ref blk) => {
|
||||
head(s, "foreach");
|
||||
print_pat(s, pat);
|
||||
word_space(s, "in");
|
||||
print_expr(s, iter);
|
||||
space(s.s);
|
||||
print_block(s, blk);
|
||||
}
|
||||
ast::expr_loop(ref blk, opt_ident) => {
|
||||
for opt_ident.iter().advance |ident| {
|
||||
word(s.s, "'");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue