On Fri, 9 Jul 2010, Richard W.M. Jones wrote:

> On Fri, Jul 09, 2010 at 05:59:02PM +0200, Julia Lawall wrote:
> > new_name = ... some code to calculate the new name ...
> > print "spatch -sp_file sp.cocci -D have_new_name -D old_name=%s -D 
> > new_name=%s -dir directory_to_work_on" % (x,new_name)
> 
> This is all a bit "indirect".
> 
> I was very surprised to find that the Python code can't just do a
> substitution itself.

It only has access to strings.  At some time in the future it will be 
possible to create metavariable bindings from within python, but it's not 
implemented for the moment...

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to