On Sun, 17 Nov 2019, Markus Elfring wrote:

> Hello,
>
> The following code example gets accepted by the Coccinelle software.
>
> @display1@
> expression* e;
> type t;
> @@
> *\( sizeof(t) \| sizeof(*e) \)
>
>
> Would it be nice if another script variant can work together with
> such a SmPL disjunction also in this way?

No.  They are quite different because the () is required on a type but
optional on an expression.

julia

>
> @display2@
> expression* e;
> type t;
> @@
> *sizeof( \( t \| *e \) )
>
>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci 
> check_sizeof2.cocci
> …
> minus: parse error:
>   File "check_sizeof2.cocci", line 5, column 17, charpos = 54
>   around = '*',
>   whole content = *sizeof( \( t \| *e \) )
>
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to