Skip to content

Commit 7d086df

Browse files
committed
Stop depending on block indices in capture.rs
1 parent 9cb2015 commit 7d086df

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/comp/middle/capture.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,15 @@ fn walk_expr(@env e, &@ast.expr x) {
7979
}
8080

8181
fn walk_block(@env e, &ast.block b) {
82-
for each (@tup(ast.ident, ast.block_index_entry) it in
83-
b.node.index.items()) {
84-
alt (it._1) {
85-
case (ast.bie_local(?local)) {
86-
e.idmap.insert(local.id, current_context(*e));
82+
for (@ast.stmt st in b.node.stmts) {
83+
alt (st.node) {
84+
case (ast.stmt_decl(?d,_)) {
85+
alt (d.node) {
86+
case (ast.decl_local(?loc)) {
87+
e.idmap.insert(loc.id, current_context(*e));
88+
}
89+
case (_) { }
90+
}
8791
}
8892
case (_) { }
8993
}

0 commit comments

Comments
 (0)