From: Markus Elfring <Markus.Elfring@web.de>
To: Jaskaran Singh <jaskaransingh7654321@gmail.com>, cocci@systeme.lip6.fr
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [Cocci] [PATCH 2/2] tests: Add test case for user comments attached to identifiers
Date: Fri, 10 Jan 2020 19:39:35 +0100 [thread overview]
Message-ID: <fd51f110-63eb-cd34-3624-a2647f1f877a@web.de> (raw)
In-Reply-To: <20200110171150.14695-3-jaskaransingh7654321@gmail.com>
> Add a test case for both of the erroneous cases.
Thanks for your contribution.
Will a slightly different subject be more appropriate for this patch?
> +@ r0 @
> +type t;
> +position p;
I suggest to omit this variable for the shown simple SmPL script.
> +@ script:python r1 @
> +id;
> +@@
> +coccinelle.id = "id/* user comment */"
> +
> +@ r2 @
> +identifier r1.id;
> +type r0.t;
> +@@
> +foo() {
> +...
> +++ t id;
> +}
This variable assignment and the addition of commented variable declarations
looks interesting.
* Can such a change be achieved also directly without using an extra
Python (or OCaml) script?
* I would usually prefer to avoid the generation of duplicate source code.
The corresponding example might demonstrate other test goals.
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2020-01-10 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 17:11 [Cocci] [PATCH 0/2] cocci: Support user comments attached to identifiers Jaskaran Singh
2020-01-10 17:11 ` [Cocci] [PATCH 1/2] parsing_c: Support user comments attached to identifier Jaskaran Singh
2020-01-10 17:11 ` [Cocci] [PATCH 2/2] tests: Add test case for user comments attached to ident Jaskaran Singh
2020-01-10 18:39 ` Markus Elfring [this message]
2020-01-11 9:18 ` [Cocci] [2/2] tests: Add test case for user comments attached to identifiers Markus Elfring
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=fd51f110-63eb-cd34-3624-a2647f1f877a@web.de \
--to=markus.elfring@web.de \
--cc=cocci@systeme.lip6.fr \
--cc=jaskaransingh7654321@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=skhan@linuxfoundation.org \
/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).