>>>> @display2@
>>>> expression check;
>>>> position display1.p;
>>>> statement display1.is, display1.es;
>>>
>>> The problem is that you inherit es.  Since you inherit it, Coccinelle
>>> considers that its presence is important, and so the isomorphism will not
>>> eliminate it.
>>
>> Thanks for your explanation of such consequences by the metavariable 
>> inheritance.

It seems that the specification of the inheritance for the metavariable “es”
can be (temporarily) omitted as a workaround.


>>> It is sufficient to make another pattern for the case with no else.
>>
>> I might stumble on another software design conflict (or the need
>> for corresponding software extensions).
>>
>> I tried the specification of the SmPL rule “display2” out because I wanted
>> to determine the source code which was matched by the SmPL nest construct
>> in the SmPL rule “display1”.
>> The specification of a SmPL disjunction in the first rule would trigger
>> other known development difficulties (or open issues), wouldn't it?
>
> No idea.

I would prefer to find the shown statement combination by a single SmPL rule.
Can the matched source code from the construct “<+... e ...+>” be assigned
to a metavariable like “check”?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to