On Wed, 10 Nov 2010, Vasiliy Kulikov wrote:
> Hi,
>
> Since some last coccinelle changes this script is not parsed by spatch:
>
> @@
> identifier X;
> identifier Y != X;
> expression E;
> statement S1, S2;
> @@
>
>
> *X = E;
> *if (!Y) S1 else S2
> --
> Fatal error: exception Failure("meta: parse error:
> = File "/home/vasya/cocci-scripts/test-wrong.cocci", line 3, column 17,
> charpos = 34
> around = 'X', whole content = identifier Y != {X};
> ")
>
> Am I missing something?
I think that before it was being parsed, but not doing what you intended.
The X in != X was a literal, not the metavariable X. If that really is
what you want, put the declaration of Y before the declaration of X. A
constraint on metavariables can only be on an inherited metavariable.
Perhaps it could be generalized to new metavariables, but that is not
implemented for now.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)