permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / ocaml.cocci
CommitLineData
174d1640
C
1@r@
2expression x,a;
3position p1, p2;
4@@
5
6f(x@p1,a@p2)
7
8@script:ocaml@
9y << r.x;
10yy << r.a;
11p1 << r.p1;
12p2 << r.p2;
13@@
14
15let p1_ = List.hd p1 in
16let file1 = p1_.Coccilib.file in
17let cure1 = p1_.Coccilib.current_element in
18let line1 = p1_.Coccilib.line in
19let line_end1 = p1_.Coccilib.line_end in
20let colb1 = p1_.Coccilib.col in
21let cole1 = p1_.Coccilib.col_end in
22
23Printf.printf "%s and %s\n" y yy;
24Printf.printf
25 "%s @ p1 (file:\"%s\" fct:\"%s\" line:%d-%d col:%d-%d)\n"
26 y file1 cure1 line1 line_end1 colb1 cole1;
27Printf.printf "%s @ p2 - p2 is not used in the SP. ocamlc should have reported a warning.\n" yy
28
29@script:ocaml@
30y << r.a;
31zz << r.x;
32@@
33
34Printf.printf "%s again and %s again \n" zz y