| 1 | @@ |
| 2 | type T; |
| 3 | identifier i; |
| 4 | expression dst; |
| 5 | struct strvec *src_ptr; |
| 6 | struct strvec src_arr; |
| 7 | @@ |
| 8 | ( |
| 9 | - for (T i = 0; i < src_ptr->nr; i++) { strvec_push(dst, src_ptr->v[i]); } |
| 10 | + strvec_pushv(dst, src_ptr->v); |
| 11 | | |
| 12 | - for (T i = 0; i < src_arr.nr; i++) { strvec_push(dst, src_arr.v[i]); } |
| 13 | + strvec_pushv(dst, src_arr.v); |
| 14 | ) |
| 15 | |
| 16 | @ separate_loop_index @ |
| 17 | type T; |
| 18 | identifier i; |
| 19 | expression dst; |
| 20 | struct strvec *src_ptr; |
| 21 | struct strvec src_arr; |
| 22 | @@ |
| 23 | T i; |
| 24 | ... |
| 25 | ( |
| 26 | - for (i = 0; i < src_ptr->nr; i++) { strvec_push(dst, src_ptr->v[i]); } |
| 27 | + strvec_pushv(dst, src_ptr->v); |
| 28 | | |
| 29 | - for (i = 0; i < src_arr.nr; i++) { strvec_push(dst, src_arr.v[i]); } |
| 30 | + strvec_pushv(dst, src_arr.v); |
| 31 | ) |
| 32 | |
| 33 | @ unused_loop_index extends separate_loop_index @ |
| 34 | @@ |
| 35 | { |
| 36 | ... |
| 37 | - T i; |
| 38 | ... when != i |
| 39 | } |
| 40 | |
| 41 | @ depends on unused_loop_index @ |
| 42 | @@ |
| 43 | if (...) |
| 44 | - { |
| 45 | strvec_pushv(...); |
| 46 | - } |