On 2/20/19 8:54 PM, Julia Lawall wrote:
> 
> 
> On Wed, 20 Feb 2019, Michael Stefaniuc wrote:
> 
>> Hello,
>>
>> is there a way to capture in a statement list the comments and empty
>> lines between statements?
>>
>> I've got asked for scripting help to merge a ton of helper functions
>> into their only caller.
>>
>> Of course it is trivial to do with coccinelle. But the comments and
>> empty lines get lost in the process:
>>
>>   spatch merge.cocci -D func=foo_base merge.c > merge.diff
>>
>>
>> It is not a big issue, only about 55 functions to merge. So I can either
>> use the above script and add the comments and newlines back. Or copy the
>> stuff manually.
> 
> Metavariables lose all of their whitespace and comments, so that that they
> can be unified against other instances that have different whitespace and
> comments.  Perhaps dropping the information could be delayed until the
> metavariable needs to be compared against another one, but that doesn't
> seem to be what is done at the moment.
Yeah, assumed there is a technical reason for this.
Not a problem as manually moving the code isn't the hard part / tedious
part. There are more transformations to be done on the moved code but
that is standard coccinelle work.

Thanks anyway
bye
        michael
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to