demos/ocaml/pg.cocci
raw| 1 | @initialize:ocaml@ |
| 2 | @@ |
| 3 | open Postgresql |
| 4 | |
| 5 | (* |
| 6 | let conn = |
| 7 | let conninfo = "" in |
| 8 | new Postgresql.connection ~conninfo () |
| 9 | *) |
| 10 | |
| 11 | @r@ |
| 12 | identifier f; |
| 13 | expression x,a; |
| 14 | @@ |
| 15 | |
| 16 | f(x,a) |
| 17 | |
| 18 | @script:ocaml@ |
| 19 | f << r.f; |
| 20 | y << r.x; |
| 21 | yy << r.a; |
| 22 | @@ |
| 23 | |
| 24 | if Str.string_match (Str.regexp "^foo") f 0 |
| 25 | then Printf.eprintf "Fct '%s' matches \"^foo\"\n" f |
| 26 | else Printf.eprintf "Fct '%s' does not match \"^foo\"\n" f |
| 27 | |
| 28 | @finalize:ocaml@ |
| 29 | @@ |
| 30 | () |
| 31 | |
| 32 | (* |
| 33 | conn#finish |
| 34 | *) |
| 35 |