permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / change_all_param.cocci
CommitLineData
978fd7e5
C
1// author: Pad. Example based on discussions with Nicholas Mc Guire.
2
3// call site
4@ r1 @
5identifier fn;
6expression ret;
7@@
8
9- ret =
10 fn(
11+ ret,
12 ...)
13
14
15@ r2 @
16identifier r1.fn;
17expression e;
18@@
19
20
21fn (...,
22- e
23+ &e
24 ,...)
25
26
27// definition site
28@@
29type T;
30identifier r1.fn;
31@@
32
33- T
34+ void
35 fn(
36+ T ret,
37 ...)
38{
39...
40}
41
42
43@ rparam @
44identifier r1.fn;
45type T;
46identifier x;
47@@
48
49fn(...,
50- T x
51+ T *x
52 ,...)
53{
54...
55}
56
57// weird, if I inline this rule in previous rule it does
58// not work
59@@
60identifier r1.fn;
61identifier rparam.x;
62@@
63fn(...)
64{
65<...
66- x
67+ *x
68...>
69}