cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Support for multi-line “when code” by SmPL?
@ 2020-05-17  8:15 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-05-17  8:15 UTC (permalink / raw)
  To: Coccinelle

Hello,

The manual for the semantic patch language provides the following information.
https://github.com/coccinelle/coccinelle/blob/7cf2c23e64066d5249a64a316cc5347831f7a63f/docs/manual/cocci_syntax.tex#L1122

…
   when ::= when != when_code
…
   when_code ::= OPTDOTSEQ(decl_stmt+, when)
               | OPTDOTSEQ(expr, when)
…
   OPTDOTSEQ(grammar_ds, when_ds) ::=
        [... (when_ds)*] grammar_ds (... (when_ds)* grammar_ds)* [... (when_ds)*]
…


The possible content is not explained for the item “grammar_ds” so far.
Examples show that source code may be specified there which should probably
be excluded from a text fragment.
https://github.com/coccinelle/coccinelle/blob/ed1eb8e06f800739d3992158d36945c0c4c6f0c7/docs/manual/examples.tex#L328

It is supported to specify the SmPL key word “when” on separate lines.
I got the impression that “grammar_ds” code needs to be specified only
in the same line so far. (A line break is treated as the final delimiter
for this use case.)
Data processing can work also with long lines.

* I imagine that developers (and reviewers) for semantic patch code
  would occasionally prefer to use multi-line text at such places.

* I imagine also that it can be helpful then to enclose the “when_code”
  by specific delimiters so that the separation of text parts would be
  clearer and hopefully safer.

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-17  8:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17  8:15 [Cocci] Support for multi-line “when code” by SmPL? Markus Elfring

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).