> The expected difference can trigger the need to express this detail
> by the usage of two identifiers based on the same metavariable type.

I guess that this wording should be clarified a bit more according to
the current software development status around the semantic patch language.
A selection of different metavariable types is supported already.
https://github.com/coccinelle/coccinelle/blob/c6d7554edf7c4654aeae4d33c3f040e300682f23/docs/manual/cocci_syntax.tex#L199

So it seems to be occasionally appropriate to use metavariables with
the same type while different names are chosen then for the corresponding
variable declaration.


Another SmPL script example:
@test@
constant c1, c2;
@@
 x =
*    c1
 ;
 x =
*    c2
 ;


Such a source code search specification is too generic so far
when you would really like to determine if these assignments (or its elements)
are equivalent or even identical (or not).

I am looking again for possibilities to improve language distinctions here.

* How can a single metavariable remember a mapping to a previous instance
  from its type?

* How will it become possible to match only a subset of a known base type?

* How often do you want to exclude something because of a previous match with
  a similar type?


Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to