>> @display1@ >> expression action, e; >> position p; >> statement is, es; >> @@ >> *e = action(...); >> if@p (<+... e ...+>) >> is >> else >> es >> >> @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 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? Regards, Markus _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci