diff options
| author | Graydon Hoare <[email protected]> | 2010-07-13 14:26:38 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-13 14:26:38 -0700 |
| commit | bb243b3aef0d17fc82808274d0b3cf92ac3c07d4 (patch) | |
| tree | 9b71189815b8da1697cdfea2277523313b780003 /src/boot/fe/item.ml | |
| parent | Modify _io's fd_buf_reader to do something slightly more useful: produce mult... (diff) | |
| download | rust-bb243b3aef0d17fc82808274d0b3cf92ac3c07d4.tar.xz rust-bb243b3aef0d17fc82808274d0b3cf92ac3c07d4.zip | |
Desugar the head stmts all the way out of STMT_for, rather than stashing them in the node. That's only necessary for STMT_while.
Diffstat (limited to 'src/boot/fe/item.ml')
| -rw-r--r-- | src/boot/fe/item.ml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml index 5270e863..0b5efd67 100644 --- a/src/boot/fe/item.ml +++ b/src/boot/fe/item.ml @@ -369,17 +369,18 @@ and parse_stmts (ps:pstate) : Ast.stmt array = let inner ps = let slot = (parse_identified_slot_and_ident false ps) in let _ = (expect ps IN) in - let lval = (parse_lval ps) in - (slot, lval) in - let (slot, seq) = + (slot, (parse_lval ps)) + in + let (slot, (stmts, lval)) = ctxt "stmts: for head" (bracketed LPAREN RPAREN inner) ps in let body_block = ctxt "stmts: for body" parse_block ps in let bpos = lexpos ps in - [| span ps apos bpos - (Ast.STMT_for + Array.append stmts + [| span ps apos bpos + (Ast.STMT_for { Ast.for_slot = slot; - Ast.for_seq = seq; + Ast.for_seq = lval; Ast.for_body = body_block; }) |] end |