Coccinelle archive on lore.kernel.org
 help / color / Atom feed
From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] Make rule depend on comment
Date: Thu, 8 Aug 2019 11:32:15 +0200
Message-ID: <eb58c296-923c-4168-bcec-504d5bb7581a@linbit.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1908072337230.2601@hadrien>

On 07.08.19 23:40, Julia Lawall wrote:
> If you pull Coccinelle from github, you will be able to write the
> following.  The code on line 2 probably has to be an ocaml script at the
> moment, because I didn't do anything to support python.  You can use the
> code that is shown in the example directly.  It checks that the list of
> comments between the ) and the { is not empty.  The second scriptcan use
> ocaml or python as you like.
> 
> @ find_kmap_tagged_function @
> comments tag : script:ocaml () { let (c1b,c1m,c1a) = List.hd tag in not
> (c1a = []) };
> identifier fn;
> @@
> fn(...)@tag {
> ...
> }
> 
> @ script:ocaml parse_kmap_tag @
> fn << find_kmap_tagged_function.fn;
> @@
> Printf.printf "have comment in %s\n" fn
> 
> --------
> 
> julia
> 

Great, thanks a lot for implementing this so quickly!

--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02  7:34 Christoph Böhmwalder
2019-08-03 12:32 ` Markus Elfring
2019-08-03 12:44 ` Julia Lawall
2019-08-05  8:36   ` Christoph Böhmwalder
2019-08-05 10:21     ` Julia Lawall
2019-08-06  7:03     ` Markus Elfring
2019-08-07 21:40     ` Julia Lawall
2019-08-08  8:35       ` Markus Elfring
2019-08-08  9:32       ` Christoph Böhmwalder [this message]
2019-08-09 15:07       ` Markus Elfring

Reply instructions:

You may reply publically 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=eb58c296-923c-4168-bcec-504d5bb7581a@linbit.com \
    --to=christoph.boehmwalder@linbit.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox