public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Subject: Re: [cocci] Reconsidering source code search challenges for nested compound statements
Date: Sun, 8 Mar 2026 19:30:19 +0100	[thread overview]
Message-ID: <8f94a463-e9ff-4b67-80e9-728e0a44779f@web.de> (raw)
In-Reply-To: <aa67fc7a-62b7-b6fd-d860-fd73623e6b77@inria.fr>

>>>> @display2@
>>>> declaration d;
>>>> statement list sl;
>>>> @@
>>>>  {
>>>>  d
>>>> *sl
>>>>  }
>>>>
>>>>
>>>> Another questionable test result:
>>>> Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> /usr/bin/spatch test-item_assignments.c ../janitor/show_compound_statements2.cocci
>>>
>>> And I should know what test-item_assignments.c is?
>>
>> Reminder:
>> This can be possible.
>> https://lore.kernel.org/cocci/f25025ab-4500-4315-b41c-53cd5775c69f@web.de/
>> https://sympa.inria.fr/sympa/arc/cocci/2026-03/msg00014.html
>>
>>
>> void my_test(void)
>> {
>>  int item;
>>
>>  if (1)
>>  {
>>     item = 1;
>>  }
>>
>>  item = 2;
>> }
> 
> A statement list metavariable only matches the code starting right after a
> {.  It can't start in random places.

Interesting …


>                                       Nothing is going to chenge here.

Will it matter then to mention for a better software documentation
if declarations would be skipped (or not)?
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/233b5ceb1d5a701fb270ebdf0a9bd6be0a6ce53b/docs/manual/cocci_syntax.tex#L348-350

Regards,
Markus

  reply	other threads:[~2026-03-08 18:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01 13:50 [cocci] Reproducing a known patch with SmPL? Markus Elfring
2026-03-01 16:51 ` Markus Elfring
2026-03-02 11:15 ` Markus Elfring
2026-03-07 10:15 ` [cocci] Reconsidering source code search challenges for nested compound statements Markus Elfring
2026-03-08 13:00   ` Markus Elfring
2026-03-08 13:24     ` Julia Lawall
2026-03-08 14:05       ` Markus Elfring
2026-03-08 14:55       ` Markus Elfring
2026-03-08 15:24         ` Julia Lawall
2026-03-08 16:08           ` Markus Elfring
2026-03-08 16:53             ` Julia Lawall
2026-03-08 17:35               ` Markus Elfring
2026-03-08 17:46                 ` Julia Lawall
2026-03-08 17:52                   ` Markus Elfring
2026-03-08 18:01                     ` Julia Lawall
2026-03-08 18:11                       ` Markus Elfring
2026-03-08 18:20                         ` Julia Lawall
2026-03-08 18:30                           ` Markus Elfring [this message]
2026-03-08 19:54                           ` Markus Elfring
2026-03-09  6:07                           ` [cocci] Too limited support for SmPL statement lists? 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=8f94a463-e9ff-4b67-80e9-728e0a44779f@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