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