All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Subject: [cocci] Improving support for unary operators with SmPL?
Date: Sat, 5 Sep 2026 16:38:57 +0200	[thread overview]
Message-ID: <db02aea1-9293-4eba-9f81-52b41a434a8f@web.de> (raw)

Hello,

Unary operators were mentioned in the manual for the semantic patch language
since a contribution by Corentin De Souza on 2020-04-02.

metadec: define them properly
https://gitlab.inria.fr/coccinelle/coccinelle/-/commit/013a81ad21ed2caf4bc5c46753828cefec4e60d5
https://github.com/coccinelle/coccinelle/commit/013a81ad21ed2caf4bc5c46753828cefec4e60d5


Thus I wonder again why an SmPL script variant (like the following) does not get accepted
also by the software combination “Coccinelle 1.3.3” so far.

@deletion@
expression x;
unary operator uo = { - };
@@
-uo
 x


Questionable test result:
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci suggestion_for_Stefan_Winter-20250402.cocci
…
meta: parse error: 
  File "suggestion_for_Stefan_Winter-20250402.cocci", line 3, column 0, charpos = 25
  around = 'unary',
  whole content = unary operator uo = { - };


Regards,
Markus

                 reply	other threads:[~2026-09-05 15:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=db02aea1-9293-4eba-9f81-52b41a434a8f@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.