On Sun, 12 May 2024, Markus Elfring wrote: > >>> Probably you should start with ... when != my_action(...) to be sure to > >>> get the first one. > >> > >> I would expect that only the first function call should be matched by > >> the initial SmPL search pattern (without an extra when constraint). > > > > Why would you expect that? > > I expect here that specific source code starts a known statement list. Coccinelle takes a pattern expressed as a CTL formula and every node in the control flow graph and tries to match the pattern at each node. The matching at one node is independent of the matching at another node. If there are conflicting matches that result in conflicting transformations, then it generates an error message. julia > > > > Coccinelle looks through your function and matches the pattern anywhere it can. > > Can this software distinguish also better statement sequences accordingly? > > > > The matches are independent of each other. > > * They can occasionally occur in different scopes. > > * Statement sequences (which include discussed repetitions) should be “interrupted” > by other source code. > > Regards, > Markus >