Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* [Cocci] Fixing SmPL scripts for data output according to structured file formats
@ 2019-11-08 12:15 Markus Elfring
  2019-11-08 12:51 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2019-11-08 12:15 UTC (permalink / raw)
  To: Coccinelle

Hello,

I have taken another look at a script for the semantic patch language.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/coccinelle/free/iounmap.cocci?id=cd0207a7bfd29016a4eeb0b0203fa900b41e4eee

It belongs to the category of SmPL scripts which support data output also for
structured file formats. The output order matters then for the integration of
additional information so that preferably valid data are provided at
appropriate places.

A well-known file format like “Org mode” expects then that specific contents
should be enclosed by corresponding tags.
https://orgmode.org/manual/Literal-Examples.html

But a SmPL rule which uses the SmPL asterisk functionality triggers immediate
output of diff hunks so far (if a source code fragment was matched).
I find such a data processing approach questionable for this operation mode.

I imagine the following solution possibilities.

1. Separate SmPL rules should be used without SmPL asterisks.

2. It would occasionally be more convenient to redirect the output to standard
   files into corresponding variables.


How would you like to improve the software situation here?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] Fixing SmPL scripts for data output according to structured file formats
  2019-11-08 12:15 [Cocci] Fixing SmPL scripts for data output according to structured file formats Markus Elfring
@ 2019-11-08 12:51 ` Julia Lawall
  2019-11-08 13:05   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2019-11-08 12:51 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]



On Fri, 8 Nov 2019, Markus Elfring wrote:

> Hello,
>
> I have taken another look at a script for the semantic patch language.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/coccinelle/free/iounmap.cocci?id=cd0207a7bfd29016a4eeb0b0203fa900b41e4eee
>
> It belongs to the category of SmPL scripts which support data output also for
> structured file formats. The output order matters then for the integration of
> additional information so that preferably valid data are provided at
> appropriate places.
>
> A well-known file format like “Org mode” expects then that specific contents
> should be enclosed by corresponding tags.
> https://orgmode.org/manual/Literal-Examples.html
>
> But a SmPL rule which uses the SmPL asterisk functionality triggers immediate
> output of diff hunks so far (if a source code fragment was matched).
> I find such a data processing approach questionable for this operation mode.
>
> I imagine the following solution possibilities.
>
> 1. Separate SmPL rules should be used without SmPL asterisks.
>
> 2. It would occasionally be more convenient to redirect the output to standard
>    files into corresponding variables.
>
>
> How would you like to improve the software situation here?

make coccicheck uses --no-show-diff at the approrpiate place so that the *
have no effect if the context option is not chosen.

julia


>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] Fixing SmPL scripts for data output according to structured file formats
  2019-11-08 12:51 ` Julia Lawall
@ 2019-11-08 13:05   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2019-11-08 13:05 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

> make coccicheck uses --no-show-diff at the approrpiate place so that the *
> have no effect if the context option is not chosen.

Thanks for your reminder on this command option.

How do you think about to look at possibilities around the redirection of output
to files so that diff hunks from matched source code fragments (according to
SmPL asterisk functionality) could be directly used from corresponding variables?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 12:15 [Cocci] Fixing SmPL scripts for data output according to structured file formats Markus Elfring
2019-11-08 12:51 ` Julia Lawall
2019-11-08 13:05   ` Markus Elfring

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
	public-inbox-index cocci

Example config snippet for mirrors

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.git