@@ -1480,41 +1480,7 @@ impure fn parse_source_stmt(parser p) -> @ast.stmt {
1480
1480
fn index_block ( vec[ @ast. stmt] stmts, option. t[ @ast. expr] expr) -> ast. block_ {
1481
1481
auto index = new_str_hash[ ast. block_index_entry ] ( ) ;
1482
1482
for ( @ast. stmt s in stmts) {
1483
- alt ( s. node ) {
1484
- case ( ast. stmt_decl ( ?d) ) {
1485
- alt ( d. node ) {
1486
- case ( ast. decl_local ( ?loc) ) {
1487
- index. insert ( loc. ident , ast. bie_local ( loc) ) ;
1488
- }
1489
- case ( ast. decl_item ( ?it) ) {
1490
- alt ( it. node ) {
1491
- case ( ast. item_fn ( ?i, _, _, _, _) ) {
1492
- index. insert ( i, ast. bie_item ( it) ) ;
1493
- }
1494
- case ( ast. item_mod ( ?i, _, _) ) {
1495
- index. insert ( i, ast. bie_item ( it) ) ;
1496
- }
1497
- case ( ast. item_ty ( ?i, _, _, _, _) ) {
1498
- index. insert ( i, ast. bie_item ( it) ) ;
1499
- }
1500
- case ( ast. item_tag ( ?i, ?variants, _, _) ) {
1501
- index. insert ( i, ast. bie_item ( it) ) ;
1502
- let uint vid = 0 u;
1503
- for ( ast. variant v in variants) {
1504
- auto t = ast. bie_tag_variant( it, vid) ;
1505
- index. insert( v. name, t) ;
1506
- vid += 1 u;
1507
- }
1508
- }
1509
- case ( ast. item_obj( ?i, _, _, _, _) ) {
1510
- index. insert( i, ast. bie_item( it) ) ;
1511
- }
1512
- }
1513
- }
1514
- }
1515
- }
1516
- case ( _) { /* fall through */ }
1517
- }
1483
+ ast. index_stmt ( index, s) ;
1518
1484
}
1519
1485
ret rec( stmts=stmts, expr=expr, index=index) ;
1520
1486
}
0 commit comments