HCoop
/
bpt
/
coccinelle.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Release coccinelle-0.2.3rc4
[bpt/coccinelle.git]
/
demos
/
ocaml
/
pg.cocci
1
@initialize:ocaml@
2
open Postgresql
3
4
(*
5
let conn =
6
let conninfo = "" in
7
new Postgresql.connection ~conninfo ()
8
*)
9
10
@r@
11
identifier f;
12
expression x,a;
13
@@
14
15
f(x,a)
16
17
@script:ocaml@
18
f << r.f;
19
y << r.x;
20
yy << r.a;
21
@@
22
23
if Str.string_match (Str.regexp "^foo") f 0
24
then Printf.eprintf "Fct '%s' matchs \"^foo\"\n" f
25
else Printf.eprintf "Fct '%s' does not match \"^foo\"\n" f
26
27
@finalize:ocaml@
28
()
29
30
(*
31
conn#finish
32
*)
33