permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / pycocci.cocci
1 @ rule1 @
2 type T; identifier I; expression C; expression E;
3 position p1, p2, p3, p4;
4 @@
5 T I@p2[C@p3];
6 <...
7 I[E@p4]
8 ...>
9 @ script:python @
10 x_mv << rule1.C; xp << rule1.p3;
11 y_mv << rule1.E; yp << rule1.p4;
12 @@
13 x = cocci.combine(x_mv, xp)
14 y = cocci.combine(y_mv, yp)
15 cocci.register_match(True, [(x, 'Array match'), (y, 'Array use')])