On Mon, 27 Jun 2011, Nicolas Palix wrote: > On Mon, Jun 27, 2011 at 5:12 PM, Ajay Panyala <[email protected]> wrote: > > Is the comment relevant for matching ? > > > > Yes, I would like to transform only the occurrence of foo(..) > > with the comment above it. The patch would replace all > > occurrences of foo(...) instead of replacing only the one > > with a comment above it. I am assuming the number of > > calls to foo(..) in the code is unknown. > > So far, Coccinelle could not be used to match comments. > Comments are considered to be SmPL comments. > You can thus only add comments. > I have tried using > > -//comment > +//comment > > but it don't work either. > > Julia, maybe matching comments is reasonable. > They are often in natural language but can also be used > by annotation systems. In that case, it could be useful > to match against them. > > Is there any problem to match them ?
They don't fit particularly well in the control-flow graph. We also assume that comments would be too free form to be usefully matched against. julia _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
