Note

For more information, see the following thread http://lists.diku.dk/pipermail/cocci/2009-April/000169.html

Fine identifier name matching

@initialize:python@
import re
m = re.compile('_new$')

@r_init@
expression E;
identifier id;
position p;
@@

E = id@p();

@script:python@
id << r_init.id;
@@

print "COCCI: Analyzing %s" % id
if m.search(id.ident) != None:
        print "COCCI: %s matchs '_new$'" % id
else:
        print "COCCI: %s discarded" % id
        cocci.include_match(False)


@r_do@
expression E;
identifier id;
position r_init.p;
@@

E = id@p();
+ if (E == NULL)
+   goto err;
 
refine_matching_on_identifiers_with_regexp_on_identifier_name.txt · Last modified: 2009/07/31 13:29 by npalix
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki