On Thu, 4 Nov 2010, Michael Stefaniuc wrote:

> Hello,
> 
> the SmPL code
> @@ @@
> + lock();
>   bar( ... );
> + unlock();
> 
> applied to
> void foo(void)
> {
>     bar(a,
>         b);
> }
> 
> will produce following diff
> +    lock();
>      bar(a,
>          b);
> +        unlock();
> 
> The indentation level of the code inserted after the multi-line function
> call matches that of the last argument and not that of the function
> identifier. I have tested this with versions 0.2.3 and 0.2.4rc5.

Thanks for the report.  I'm not surprised that it does this, but I'm not 
sure that I can easily fix it either.  It just has a stream of tokens when 
it is doing the unparsing, not a parse tree.  It is also thrown off when 
you add a statement after a conditional where the branch is indented.  
That case is indeed probably harder, because there is a complete statement 
on the line before.

Anyway, I will look into the function call case.

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

Reply via email to