Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robert.Larice@t-online.de (Robert Larice)
To: cocci@systeme.lip6.fr
Subject: [Cocci] please help me with a "repetition"
Date: Sun, 29 Apr 2018 14:54:17 +0200	[thread overview]
Message-ID: <kk604a2mx2.fsf@bora.foobar.de> (raw)
In-Reply-To: <alpine.DEB.2.20.1804291328170.4211@hadrien> (Julia Lawall's message of "Sun, 29 Apr 2018 13:32:18 +0200 (CEST)")

Julia Lawall <julia.lawall@lip6.fr> writes:

> On Sun, 29 Apr 2018, Robert Larice wrote:
>
>> Hello,
>>
>>   probably a stupid question,
>>   I'm failing to match something like this
>>
>> +  int newvar;
>>    i++; i++; ... any sequence of only "i++";
>> +  buckbear(42);
>>
>>   I don't succeed to express this "maximum length repetition"
>>     in the mids of those two insertions.
>
> It's not completely straightforward.  You could try:
>
> @r1@
> position p;
> @@
>
> ...

Thank You very much,

  your suggestion works perfectly well in my actual task.

  I was trying something different,
  very aproximately something like:
      ... when != i++;
    + int newvar;
      i++;
  and didn't get anywhere.

Thanks !
  Robert

  reply	other threads:[~2018-04-29 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-29 11:00 [Cocci] please help me with a "repetition" Robert Larice
2018-04-29 11:32 ` Julia Lawall
2018-04-29 12:54   ` Robert Larice [this message]
2018-04-29 13:15     ` 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=kk604a2mx2.fsf@bora.foobar.de \
    --to=robert.larice@t-online.de \
    --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