Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Cc: Julia Lawall <julia.lawall@inria.fr>
Subject: Re: [cocci] Detecting statements from the last if branch (with SmPL)?
Date: Thu, 23 Nov 2023 19:35:55 +0100	[thread overview]
Message-ID: <2856c52e-f080-4cc3-a823-4bf4a35b7353@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2311231930330.3125@hadrien>

>>>> https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/8d66511d00b27de44e5c21b60d41938d32321b1a/docs/Coccilib.3cocci#L226
>>>>
>>>> How do you think about to provide a function variant which can copy relevant data
>>>> from a previous position object directly?
>>>
>>> I don't see why it would be useful.
>>
>> Would you find any other code variant more reasonable than an approach
>> like the following?
>>
>> @script:python selection@
>> places << find.pos;
>> marker;
>> @@
>> place = places[-1]
>> coccinelle.marker = cocci.make_position(place.file,
>>                                         place.current_element,
>>                                         int(place.line),
>>                                         int(place.column),
>>                                         int(place.line_end),
>>                                         int(place.column_end))
>
> I don't know python.  It could be ok.

Would any other developers get into the mood to add more constructive comments
according to shown implementation details?

Regards,
Markus

  reply	other threads:[~2023-11-23 18:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 17:08 [cocci] Detecting statements from the last if branch (with SmPL)? Markus Elfring
2023-11-22 17:28 ` Julia Lawall
2023-11-22 18:50   ` Markus Elfring
2023-11-22 20:33     ` Julia Lawall
2023-11-22 20:55       ` Markus Elfring
2023-11-22 20:59         ` Julia Lawall
2023-11-22 21:04           ` Markus Elfring
2023-11-22 21:21             ` Julia Lawall
2023-11-22 21:24               ` Markus Elfring
2023-11-23 14:05           ` Markus Elfring
2023-11-23 17:46             ` Julia Lawall
2023-11-23 18:16               ` Markus Elfring
2023-11-23 18:31                 ` Julia Lawall
2023-11-23 18:35                   ` Markus Elfring [this message]
2023-11-23 17:40           ` Markus Elfring
2023-11-23 17:45             ` Julia Lawall
2023-11-23 17:55               ` Markus Elfring
2023-11-23 17:57                 ` Julia Lawall
2023-11-23 18:05                   ` 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=2856c52e-f080-4cc3-a823-4bf4a35b7353@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.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 read-only IMAP folder(s) and NNTP newsgroup(s).