permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / pcre2.cocci
CommitLineData
993936c0
C
1@m@
2identifier SPAM ;
3@@
4
5SPAM
6
7@script:ocaml r@
8s << m.SPAM;
9new_s;
10@@
11
12let re = Pcre.regexp "(WINE_)?(ERR|FIXME|WARN)" in
13if Pcre.pmatch ~rex:re s then
14(Printf.eprintf "Match %s\n" s;
15 new_s := Pcre.replace_first ~pat:"WINE_" s
16)
17else
18(Printf.eprintf "Not match %s\n" s;
19 Coccilib.include_match false
20)
21
22@@
23identifier m.SPAM;
24identifier r.new_s;
25@@
26
27-SPAM
28+new_s