On Tue, 23 Aug 2011, SF Markus Elfring wrote:

> > It is a very hard problem to beautify code.
> 
> I agree to this opinion.
> 
> 
> > Coccinelle needs to make the code readable and to try to respect the
> > existing style.
> 
> How does your tool recognise the used coding style?

It looks at neighboring lines to see how they are indented.

> Example: Where do you want to place curly braces if an instruction block like
> "if" will be adjusted?

If you are writing the whole if, then you can put the braces where you 
want, and use the -smpl_spacing argument.  If the curly braces are added 
because you are adding some code inside an if branch and coccinelle 
spontaneously adds the curly braces to maintain the parse tree, then you 
will be stuck with Coccinelle's default.

> > If one is generating complete functions, then perhaps the situation is
> > different.
> 
> It seems that Ajay Panyala was interested in such an use case.
> http://lists.diku.dk/pipermail/cocci/2011-August/002117.html

Sure.  I have done that as well.  But I suspect that it is not the most 
common use.

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

Reply via email to