If you pull Coccinelle from github, you will be able to write the
following.  The code on line 2 probably has to be an ocaml script at the
moment, because I didn't do anything to support python.  You can use the
code that is shown in the example directly.  It checks that the list of
comments between the ) and the { is not empty.  The second scriptcan use
ocaml or python as you like.

@ find_kmap_tagged_function @
comments tag : script:ocaml () { let (c1b,c1m,c1a) = List.hd tag in not
(c1a = []) };
identifier fn;
@@
fn(...)@tag {
...
}

@ script:ocaml parse_kmap_tag @
fn << find_kmap_tagged_function.fn;
@@
Printf.printf "have comment in %s\n" fn

--------

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to