/usr/share/doc/coccinelle-doc/examples/ocaml1.cocci is in coccinelle-doc 1.0.0~rc10.deb-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | @initialize:ocaml@
let a = ref 0
let _ = Printf.printf "starting ocaml\n"
@r@
expression x,a;
@@
f(x,a)
@script:ocaml@
y << r.x;
yy << r.a;
@@
a := !a + 1;
Printf.printf "%s and %s\n" y yy
@script:ocaml@
y << r.a;
zz << r.x;
@@
a := !a + 1;
Printf.printf "%s again and %s again \n" zz y
@finalize:ocaml@
Printf.printf "ending ocaml %d\n" !a
|