On Thu, 11 Jan 2018 14:30:16 +0100 SF Markus Elfring <[email protected]> wrote:
> > @@ > > constant char *stock_constant =~ "^GTK_STOCK"; > > @@ > > > > -"+" stock_constant > > +stock_constant > > > > For starters, Coccinelle doesn't seem to recognize string > > juxtaposition (spatch gives me an error when I try this); > > It would be nice if this small source code adjustment could be > specified also for the semantic patch language in such a convenient > and succinct way. But the Coccinelle software provides a specific > behaviour for string literals so far. I imagine then that you could > achieve the desired transformation with an other approach. > > * How do you think about to choose any of the supported programming > languages for the construction of corresponding SmPL script rules? > http://coccinelle.lip6.fr/docs/main_grammar003.html > > * A “constant” could be stored in a script variable by this > metavariable type. http://coccinelle.lip6.fr/docs/main_grammar002.html > > The received input string can be adjusted in ways you like by > additional function calls from the available programming interfaces. > Would you like to propagate the constructed value back to another > script rule by calling the SmPL method “make_expr”? > > Regards, > Markus > I'm *very* much new to Coccinelle, so I think I'll have to trying the scripting interface as per Julia's suggestion. I think I need to experiment with Coccinelle a bit (or a lot!) more to get the hang of it. -Rob _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
