[Cocci] Branch layout for if statements with SmPL disjunctions

SF Markus Elfring elfring at users.sourceforge.net
Wed Feb 26 08:25:35 CET 2014

>> ( 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?

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.


More information about the Cocci mailing list