Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Transformation challenges with SmPL around “LIST_FOR_EACH_ENTRY”
Date: Sat, 2 Dec 2017 11:03:41 +0100	[thread overview]
Message-ID: <1dacc554-c03c-6d4e-e559-15ac92ac9f80@users.sourceforge.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1712021046000.2168@hadrien>

>> @adjustment@
>> expression ex;
>> statement S;
>> @@
>> -LIST_FOR_EACH_ENTRY
>> +hlist_for_each_entry
>>  (..., ...,
>> -ex,
>>  ...)
>>  S
> 
> This is not completely a good idea.

I tried to show another approach.


> The ... in the argument list will match a sequence of things, not a single thing.

How does this information fit to the specification of the SmPL ellipsis
as a placeholder for the last macro parameter?


> It could be:
> 
> -LIST_FOR_EACH_ENTRY
> +hlist_for_each_entry
>  (e1,e2,

Are these metavariables required for such an use case?


> -ex,
>  ...)
>  S

Can such a transformation variant have nicer run time characteristics
in comparison to the initial SmPL script example?

Regards,
Markus

  reply	other threads:[~2017-12-02 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02  8:03 [Cocci] BUG: possible parsing issue Brandeburg, Jesse
2017-12-02  8:12 ` Julia Lawall
2017-12-02  8:14 ` Julia Lawall
2017-12-02  9:20   ` [Cocci] Transformation challenges with SmPL around “LIST_FOR_EACH_ENTRY” SF Markus Elfring
2017-12-02  9:47     ` Julia Lawall
2017-12-02 10:03       ` SF Markus Elfring [this message]
2017-12-02 10:06         ` Julia Lawall
2017-12-04 18:05   ` [Cocci] BUG: possible parsing issue Jesse Brandeburg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1dacc554-c03c-6d4e-e559-15ac92ac9f80@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox