On Fri, 11 Jan 2019, Jerome Glisse wrote:

> Hi,
>
> I am trying to add a field to struct however coccinelle insist on
> adding it on the same line as struct name definition ie:
>
> spatch:
> @@
> @@
> struct foo {
> +int roto;
> ...
> }
>
> original c code:
> struct foo {
>     int titi;
> };
>
> result:
> struct foo {int roto;
>     int titi;
> };
>
>
> This is kind of ugly and i am at loss trying to force a new line ie:
> struct foo {
>     int roto;
>     int titi;
> };
>
>
>
> Funny thing, trying to out smart coccinelle with:
> @@
> identifier I1;
> type T1;
> @@
> struct foo {
> T1 I1;
> +int roto;
> ...
> }
>
> Gives:
> struct foo {
>     int titi;int roto;
> };
>
>
> I am still scratching my head on how i can force a new line. There
> does not seem to have \n or any escape sequence i can use to force
> new line.

Sorry, it seems to be a pretty printing problem.  I will fix it.

julia

>
> Thank you for any pointers toward that.
> Jérôme
> _______________________________________________
> Cocci mailing list
> [email protected]
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to