On Sat, 28 Nov 2020, Markus Elfring wrote:
> Hello,
>
> The following small SmPL script gets successfully parsed by the Coccinelle
> software.
>
>
> @Replacement@
> expression call, input, target;
> identifier gs;
> @@
> -\( g_string_assign@gs \| g_string_append@gs \) (target, input);
> call (
> - target
> + gs (target, input)
> );
>
>
> But if I would like to omit the semicolon in the last line, I stumble on
> the error message “incompatible minus and plus code starting on lines 5 and
> 6”.
> Can such a software limitation be adjusted?
Why do you want to remove the semicolon?
If you want to find the call somewhere in the next statement, you can say
(
S
&
call(
...
)
)
where S is a statement metavariable. I'm not sure what will happen if
there are two occurrences of call in the statement.
julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci