cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@kernel.org>
To: cocci <cocci@systeme.lip6.fr>
Subject: [Cocci] How to concatenate identifier with text?
Date: Fri, 24 May 2019 14:13:42 -0500	[thread overview]
Message-ID: <CAOZdJXWVyC3o6vVbNEakhr8p4vX4j3wkkSyJg77-hcQ7Nqhf=g@mail.gmail.com> (raw)

@@
identifier func;
@@
func(...) {
<+...
     .... stuff
+   goto func_exit;
+}
...+>
}

So if I have this code:

void myfunc(int x)
{
}

I want it to look like this:

void myfunc(int x)
{
    goto myfunc_exit;
}

My problem is that cocci takes "func_exit" literally.  I tried
func##_exit, but that didn't work.  How do I make this work?
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

             reply	other threads:[~2019-05-24 19:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 19:13 Timur Tabi [this message]
2019-05-24 19:36 ` [Cocci] How to concatenate identifier with text? Timur Tabi
2019-05-24 19:38   ` Julia Lawall
2019-06-11 21:51     ` Timur Tabi
2019-06-11 21:58       ` Timur Tabi
2019-06-12  7:12         ` [Cocci] Wider usage of “fresh identifiers”? Markus Elfring
2019-06-12  5:25       ` [Cocci] How to concatenate identifier with text? Julia Lawall
2019-05-24 19:38 ` 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='CAOZdJXWVyC3o6vVbNEakhr8p4vX4j3wkkSyJg77-hcQ7Nqhf=g@mail.gmail.com' \
    --to=timur@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).