On Mon, 8 Jun 2020, Denis Efremov wrote:
>
> >> @r depends on !patch@
> >> // It doesn't work. Is it normal?
> >> //position p: script:python() { matches.extend(p); relevant(p) };
> >
> > "Doesn't work" means you get a parse error? The parser of the code inside
> > the {} is pretty fragile. Perhaps this could be improved somewhat, but it
> > is limited by the fact that Coccinelle doesn't know how to parse python
> > properly.
>
> It prints "hd" and exits.
OK, it's a form of parse error.
>
> > This seems entirely reasonable. You can collect the places that are
> > matched in a variable declared in the initialize, and then look at that
> > variable in the finalize.
>
> I need a list of all files spatch tries to process. A list of files in which
> spatch finds some matches is not enough. Otherwise the approach will
> incorrectly
> work when cocci script runs on a subset of kernel files, e.g.,
> make coccicheck M=drivers/net
OK, just make a python rule that will run on every file.
@script:python@
@@
do something with cocci.files()
---
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci