[Cocci] Branch layout for if statements with SmPL disjunctions

Julia Lawall julia.lawall at lip6.fr
Wed Feb 26 10:39:04 CET 2014

On Wed, 26 Feb 2014, SF Markus Elfring wrote:

> >> ( if (input) is
> >> | if (likely(input)) is
> >> )
> >>   else es
> >
> > This is not allowed.  Inside a disjunction you need to have complete terms.
> I imagine that it would be nice if parts from an if statement could be
> written in the shown way. Would such an extension be useful for the
> semantic patch language?

No, I think that simple rules are better.  Always use complete terms is a
simple rule.


> I can easily adjust my simple pattern here because each if branch will be
> matched by a metavariable. I hope that the corresponding repetition of bigger
> subpatterns can be avoided in the future.
> Regards,
> Markus

More information about the Cocci mailing list