On Thu, 2 May 2019, Michael Stefaniuc wrote:

> Hello,
>
> it seems that more than one declaration cannot be matched in one rule:
>
> @@
> identifier i, f;
> @@
> - int i;
> - int f;
>
> That won't match
>
> void foo(void)
> {
>     int i;
>     float f;

The semantic patch has int int and the code has int float.  If the code
has int int, it matches fine.

julia

> }
>
>
> Is there a way to do that?
> In my specific case I need to replace 3 declarations with a single
> declarer. I can use 3 separate rules but the first rule will produce
> false positives if the other two declarations aren't there.
>
>
> thanks
> bye
>       michael
> _______________________________________________
> Cocci mailing list
> [email protected]
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to