[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.22.394.2009241631310.2615@hadrien>
Date: Thu, 24 Sep 2020 16:32:30 +0200 (CEST)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Markus Elfring <Markus.Elfring@....de>
cc: Sumera Priyadarsini <sylphrenadin@...il.com>,
Coccinelle <cocci@...teme.lip6.fr>,
Michal Marek <michal.lkml@...kovi.net>,
Gilles Muller <Gilles.Muller@...6.fr>,
Nicolas Palix <nicolas.palix@...g.fr>,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Cocci] [PATCH] coccinelle: iterators: Add for_each_child.cocci
script
On Thu, 24 Sep 2020, Markus Elfring wrote:
> > +@...etwo depends on patch && !context && !org && !report@
>
> How do you think about to combine code from two SmPL rules
> by using another SmPL disjunction like the following?
What is the goal of doing this?
It seems substantially harder to understand than three rules that each
take care of a specific case.
julia
>
> @addition_rule depends on patch && !context && !org && !report@
> local idexpression r.n;
> expression e,e1;
> expression list [r.n1] es;
> iterator r.i,i1,i2;
> statement S,S2;
> @@
> (
> i(es,n,...) {
> ...
> (of_node_put(n);
> |e = n
> |return n;
> |i1(...,n,...) S
> |
> +of_node_put(n);
> ?return ...;
> )
> ... when any
> }
> |
> i(es,n,...) {
> ...
> (of_node_put(n);
> |e = n
> |i1(...,n,...) S
> |
> +of_node_put(n);
> ?break;
> )
> ... when any
> }
> ... when != n
> when strict
> (n = e1;
> |
> ?i2(...,n,...) S2
> )
> )
>
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@...teme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
Powered by blists - more mailing lists