permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / python_regexp.cocci
CommitLineData
708f4980
C
1@initialize:python@
2import re
3m = re.compile('_new$')
4
5@r_init@
6expression E;
7identifier id;
8position p;
9@@
10
11E = id@p();
12
13@script:python@
14id << r_init.id;
15@@
16
17print "COCCI: Analyzing %s" % id
18if m.search(id.ident) != None:
19 print "COCCI: %s matchs '_new$'" % id
20else:
21 print "COCCI: %s discarded" % id
22 cocci.include_match(False)
23
24
25@r_do@
26expression E;
27identifier id;
28position r_init.p;
29@@
30
31E = id@p();
32+ if (E == NULL)
33+ goto err;