On Thu, 25 Jun 2020, Markus Elfring wrote:

> Hello,
>
> I know that the following SmPL script example gets accepted
> by the Coccinelle software.
>
> @display@
> expression x, y;
> @@
> *y = ... *(x) ...

This is probably not what you think.  It is an assignment of y to a
multiplication followed by some other code (the second ...).

julia

>
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
>
> @display@
> expression action, x, y;
> @@
> (
> *y = ... *(x) ...
> |
> *action(..., x, ...)
> )
>
>
> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci 
> show_pointer_dereferences3.cocci
> init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
> minus: parse error:
>   File "show_pointer_dereferences3.cocci", line 5, column 14, charpos = 54
>   around = '...',
>   whole content = *y = ... *(x) ...
>
>
> Should such SmPL disjunctions work in the future?
>
> 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