On Fri, 27 Mar 2020, Christoph Böhmwalder wrote:

> Am 27.03.20 um 16:47 schrieb Julia Lawall:> Are you sure that the C code is
> parsed successfully?  I'm not at all sure
> > that static is allowed in an argument list.  Types are allowed, bu static
> > is only part of a type.
>
> I'm pretty sure it is parsed successfully. At least spatch doesn't complain
> about it, no matter how many debug flags I specify.

Did you try spatch --parse-c file.c?

>
> I really only want to swap out the last parameter, but I'm having trouble
> coming up with the syntax. This should match, right?
>
> @@
> declarer name RB_DECLARE_CALLBACKS_MAX;
> identifier NODE_END;
> @@
> RB_DECLARE_CALLBACKS_MAX(...,
> - NODE_END
> + compute_subtree_last
>  );

If the code is getting parsed, this should be fine.

Do you want to actually match NODE_END?  If so, it shouldn't be declared
as a metavariable.

julia

> > For augment_callbacks, either identifier or expression would be fine.
> > Coccinelle has no idea what is going to happen to augment_callbacks
> > afterwards.  It just sees a sequence of characters and classifies it as an
> > identifier.
>
> That's what I thought, thank you for confirming.
>
> > julia
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to