Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr, Julia Lawall <julia.lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Li Zetao <lizetao1@huawei.com>
Subject: Re: [cocci] Improving support for handling of optional items in deletion patterns
Date: Fri, 4 Aug 2023 21:10:14 +0200	[thread overview]
Message-ID: <4a4a38a1-67ef-432b-816d-9e8e7e9e7b89@web.de> (raw)
In-Reply-To: <8a77bfa1-267a-4455-9614-ef3392e526ff@inria.fr>

> Normally, you can't put + code after a disjunction.  Because the two
> branches of the disjunction might cause the matching process to end up in
> two different places.
>
> The fact that you are suggesting to do this seems to suggest that you
> think that the Coccinelle semantic patch parser accepts this code.  But I
> have no idea whether it does.  It should not in any case.

Will the chances grow to reconsider involved application concerns any more?

An SmPL disjunction is used here to achieve the deletion of a statement
which contains an optional item (like the key word “return” in the discussed case).
Regular expressions support the quantifier “question mark” for such a purpose.
Do you see possibilities that the semantic patch language can support
such functionality also in a succinct way for SmPL deletion code?

Regards,
Markus

  parent reply	other threads:[~2023-08-04 19:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01  9:43 [cocci] [PATCH -next] coccinelle: platform_get_irq: Add dev_err_probe() check Li Zetao
2023-08-01 15:26 ` Markus Elfring
2023-08-01 15:32   ` Julia Lawall
2023-08-01 15:45     ` Markus Elfring
2023-08-01 15:50       ` Julia Lawall
2023-08-01 16:01         ` Markus Elfring
2023-08-04 19:10         ` Markus Elfring [this message]
2023-08-03  9:00 ` Markus Elfring
     [not found]   ` <20230803094241.733300-1-lizetao1@huawei.com>
2023-08-03 10:10     ` [cocci] [PATCH -next v2] " Markus Elfring
2023-08-03 10:12       ` Julia Lawall
2023-08-03 10:21         ` [cocci] [-next " Markus Elfring

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=4a4a38a1-67ef-432b-816d-9e8e7e9e7b89@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.fr \
    --cc=lizetao1@huawei.com \
    --cc=nicolas.palix@imag.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).