[...]
>
> @script:python nm@
> c << case2.c;
> uc;
> newc1;
> newc2;
> @@
>
> uc = "%s" % c
> uc = re.sub(r'^"', r'', uc)
> uc = re.sub(r'"$', r'', uc)
> coccinelle.newc1 = "\"%s%%s\"" % uc
> coccinelle.newc2 = "\"%%s%s\"" % uc
>

OK, in case anyone is interested, here is a three-line version of this
same script, which doesn't require to "import re":

uc = str(c)[1:-1]
newc1 = "\"" + uc + "%s\""
newc2 = "\"%s" + uc + "\""

-- 
Francis Galiegue, [email protected]
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to