All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: rep.dot.nop@gmail.com, cocci@inria.fr
Subject: Re: [cocci] HELP: multiple inserts at one position
Date: Thu, 9 Mar 2023 11:15:41 +0100	[thread overview]
Message-ID: <20230309111541.4bd397f5@nbbrfq> (raw)
In-Reply-To: <95103e65-6f5a-ae64-8ab2-7c57e5ca9438@inria.fr>

On Thu, 9 Mar 2023 10:38:50 +0100 (CET)
Julia Lawall <julia.lawall@inria.fr> wrote:

> > Now, mere cosmetics, but is there a way to retain the spaces before the
> > braces in the replacement?
> 
> Try the argument --smpl-spacing.

That does the trick, thanks!

Is there a way to use regexp captures for the matching and replacement
part? Think templates for (parts of) the name of the identifiers.

In the specific case of mpz and mpfr, both use a similar API for the
allocators {mpfr,mpz}_init{,2,3,_set_str} and deallocators
{mpfr,mpz}_clear{,s}

To avoid duplicating the rules for "mpfr" and "mpz", it would be handy
to match and replace per the underlying type or, maybe, a part of the
matched identifier name. Is that something that is readily available?

Just curious, it's not all that important..

thanks for your prompt help so far!

  reply	other threads:[~2023-03-09 10:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  8:28 [cocci] HELP: multiple inserts at one position Bernhard Reutner-Fischer
     [not found] ` <89959f1e-b5ed-6b2c-2931-4fdd65428e89@inria.fr>
2023-03-09  8:47   ` Julia Lawall
2023-03-09  9:10     ` Bernhard Reutner-Fischer
2023-03-09  9:38       ` Julia Lawall
2023-03-09 10:15         ` Bernhard Reutner-Fischer [this message]
2023-03-09 10:23           ` Julia Lawall
2023-03-10 10:01     ` Bernhard Reutner-Fischer
2023-03-10 10:12       ` Julia Lawall
2023-03-13 19:38         ` Bernhard Reutner-Fischer
2023-03-13 21:09           ` Julia Lawall

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=20230309111541.4bd397f5@nbbrfq \
    --to=rep.dot.nop@gmail.com \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@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.