cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Adding a field to struct and new line issues
@ 2019-01-11 22:24 Jerome Glisse
  2019-01-12  6:14 ` Julia Lawall
  2019-01-12 16:45 ` Julia Lawall
  0 siblings, 2 replies; 4+ messages in thread
From: Jerome Glisse @ 2019-01-11 22:24 UTC (permalink / raw)
  To: cocci

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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-12 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 22:24 [Cocci] Adding a field to struct and new line issues Jerome Glisse
2019-01-12  6:14 ` Julia Lawall
2019-01-12 16:45 ` Julia Lawall
2019-01-12 17:51   ` Jerome Glisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).