File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Moves
2+ #
3+ # use: sed [-E | -r] -i -f move-declarators.sed [files]
4+
5+ # Arrays
6+ # cdef int a[5] -> cdef int[5] a
7+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) + ( [_0-9a-zA-Z] + ) (( \[ [0-9] * \] ) + ) $ /\1 cdef \2\4 \3 /
8+
9+ # Pointers
10+ # cdef int a, *b -> cdef int a \n cdef int *b
11+
12+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) ( + [_0-9a-zA-Z] + + ( =[^ ()] + ) ? ) ,( * [*] + * ) ( [^ ()] + ) /\1 cdef \2\3 \
13+ \1 cdef \2\5\6 /
14+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) ( + [_0-9a-zA-Z] + + ( =[^ ()] + ) ? ) ,( * [*] + * ) ( [^ ()] + ) /\1 cdef \2\3 \
15+ \1 cdef \2\5\6 /
16+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) ( + [_0-9a-zA-Z] + + ( =[^ ()] + ) ? ) ,( * [*] + * ) ( [^ ()] + ) /\1 cdef \2\3 \
17+ \1 cdef \2\5\6 /
18+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) ( + [_0-9a-zA-Z] + + ( =[^ ()] + ) ? ) ,( * [*] + * ) ( [^ ()] + ) /\1 cdef \2\3 \
19+ \1 cdef \2\5\6 /
20+ s /^ ( [ \t ] * ) cdef + ( [_0-9a-zA-Z. ] + ) ( + [_0-9a-zA-Z] + + ( =[^ ()] + ) ? ) ,( * [*] + * ) ( [^ ()] + ) /\1 cdef \2\3 \
21+ \1 cdef \2\5\6 /
You can’t perform that action at this time.
0 commit comments