All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Elia Pinto <gitter.spiros@gmail.com>, cocci@inria.fr
Subject: Re: [cocci] Reducing the scope for variables with SmPL
Date: Fri, 11 Nov 2022 20:10:11 +0100	[thread overview]
Message-ID: <7cdca517-6fda-af5d-a7fc-75989e4e79df@web.de> (raw)
In-Reply-To: <516d8b97-907f-5a7b-41af-ff162ffe7316@web.de>

>> or should the semantic patch be done better?
> How do you think about software development possibilities with the following
> script variant for the semantic patch language?


@movement disable decl_init@
type T;
identifier I;
initializer init;
expression E1, E2, E3;
statement S;
@@
(
-T I = init;
 ... when != I
 for (
+     T
      I =
-         E1
+         init
      ; E2; E3
     )
 S
 ... when != I
|
-T I;
 ... when != I
 for (
+     T
      I = E1; E2; E3
     )
 S
 ... when != I
)



Would you like to reduce the scope for any more variables?
https://refactoring.com/catalog/reduceScopeOfVariable.html


Does such a source code transformation approach point also any opportunities out
for further improvements of the corresponding software documentation?

Regards,
Markus

  reply	other threads:[~2022-11-11 19:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 11:42 [cocci] Possible bug in a semantic patch Elia Pinto
2022-11-09 11:49 ` Julia Lawall
2022-11-09 20:21 ` [cocci] Fixing the adjustment of variable declarations Markus Elfring
2022-11-11 19:10   ` Markus Elfring [this message]
2022-11-12  9:42   ` Markus Elfring
2022-11-12 10:38     ` Markus Elfring
2022-11-12 11:17       ` Julia Lawall
2022-11-12 11:45         ` Markus Elfring
2022-11-13 10:30     ` Markus Elfring
2022-11-13 10:36       ` Julia Lawall
2022-11-13 12:26         ` Markus Elfring
2022-11-13 14:10           ` Julia Lawall
2022-11-13 14:23             ` Markus Elfring
2022-11-13 14:28               ` Julia Lawall
2022-11-13 14:55                 ` Markus Elfring
2022-11-13 15:19                   ` Julia Lawall
2022-11-13 15:36                     ` 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=7cdca517-6fda-af5d-a7fc-75989e4e79df@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=gitter.spiros@gmail.com \
    /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.