On Wed, 22 Feb 2012, Terry Wilson wrote:

Version 1.0.0-rc10 is now available.  There are a number of changes:

It seems like exporting variables from a python script got broken. In rc9 this 
worked:
test.cocci
----------
@s@
identifier i =~ "^one$|^two$";
struct thing *thing;
@@

thing->i

@script:python p@
i << s.i;
setter;
@@

coccinelle.setter = "set_%s" % (i,)

@t@
identifier s.i, p.setter;
struct thing *thing;
expression E;
@@

- thing->i = E
+ setter(thing, E)

test.c
------
struct thing {
   int one;
   const char *two;
};

int main(int argc, char *argv[])
{
   struct thing *t = new_thing();

   t->one = 1;
   t->two = "bug";
   return 0;
}

test.res
--------
struct thing {
   int one;
   const char *two;
};

int main(int argc, char *argv[])
{
   struct thing *t = new_thing();

   set_one(t, 1);
   set_two(t, "bug");
   return 0;
}

But in rc10, this:
@script:python p@
i << s.i;
setter; // <---- Right here
@@

causes:
AttributeError: 'module' object has no attribute 'Identifier'
Failure in p
Fatal error: exception Pycocci.Pycocciexception

Is this a regression, or is there a new way of doing this?

That was not intended.  I will fix it today.

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

Reply via email to