On Sun, 29 Nov 2020, Markus Elfring wrote:

> > In your rule.  In the place of A, in my example.
>
> I find such information too terse.
>
> I hope that the software documentation will be improved further for 
> transformation loops.
>
>
> > I would still suggest to have one rule per function, rather than trying to
> > do everything at once.
>
> I have tried such a SmPL script variant out a moment ago.
>
> elfring@Sonne:~/Projekte/Gnome/Evolution-Data-Server/lokal> spatch 
> --smpl-spacing --max-width 120 src/addressbook/libedata-book/e-book-sqlite.c 
> ~/Projekte/Gnome/use_string_action_return_pointer9.cocci
> init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
> HANDLING: src/addressbook/libedata-book/e-book-sqlite.c
>
> previous modification:
> MINUS
>
> According to environment 2:
>    Replacement2.input1 -> field->dbname
>
>    Replacement2.gs -> id g_string_append
>
>
> current modification:
>
>   <<< gs(
> CONTEXT
>   >>> , input1)
>
>
> According to environment 2:
>    Replacement2.input1 -> ", "
>
>    Replacement2.gs -> id g_string_append
>
>
> Replacement2: already tagged token:
> C code context
> File "src/addressbook/libedata-book/e-book-sqlite.c", line 3629, column 21, 
> charpos = 101199
>   around = 'string',
>   whole content =                             g_string_append (string, 
> field->dbname);

Since you have provided neither your semantic patch nor the source code to
which it is applied, this information is not useful.

> Do you find the implementation of a function like “ebsql_prepare_insert” more 
> interesting then?
> https://gitlab.gnome.org/GNOME/evolution-data-server/-/blob/3de7ea5fdb5d5db4a097a4d888d77bd2778c1c30/src/addressbook/libedata-book/e-book-sqlite.c#L3598

I'm not sure that Coccinelle is well suited for the problem you are trying
to address.  Normally, one works on code fragments that are more disjoint
from each other.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to