> I'm asking you to put the regexp in a python function.
Will it become easier and more convenient to search for string literals
(and their exclusion according to the discussed transformation approach)?
@initialize:python@
@@
def occurs(x):
return '"' in x
@display@
identifier i =~ "^(?:[A-Z]+_){3,3}[A-Z]+";
expression e : script:python() { occurs(e) };
@@
*#define i e
elfring@Sonne:~/Projekte/PipeWire/lokal> spatch
~/Projekte/Coccinelle/janitor/show_define_usage8.cocci
spa/include/spa/node/type-info.h
…
@@ -35,8 +35,6 @@ extern "C" {
#include <spa/node/event.h>
#include <spa/node/io.h>
-#define SPA_TYPE_INFO_IO SPA_TYPE_INFO_ENUM_BASE "IO"
-#define SPA_TYPE_INFO_IO_BASE SPA_TYPE_INFO_IO ":"
static const struct spa_type_info spa_type_io[] = {
{ SPA_IO_Invalid, SPA_TYPE_Int, SPA_TYPE_INFO_IO_BASE "Invalid", NULL },
…
How will the software design clarification evolve further?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci