Skip to contentSkip to conversation

Supporting expression fragments with SmPL dot variants?

cocci Markus Elfring 2 participants 3 messages Jul 27, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

I would like to try something out with another script for the semantic patch language.

@display@
expression x, y;
@@
*(1 * x) /
...
*(2 * y) /
<+...
*(4 * x) /
...+>

Unfortunately, I stumbled on the following test result then.

Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_questionable_evaluation_order1.cocci …
minus: parse error:
File "show_questionable_evaluation_order1.cocci", line 9, column 1, charpos = 76
around = '...+>',
whole content = ...+>

Can the data processing be extended anyhow also for expression fragments?

Regards,
Markus

#1 lore raw
Quoted 5 lines · Markus Elfring

Hello,

I would like to try something out with another script for the semantic patch language.

Quoted 9 lines

@display@
expression x, y;
@@
*(1 * x) /
...
*(2 * y) /
<+...
*(4 * x) /
...+>

You have to make a real expression. What you show is not a real expression.

julia

Quoted 17 lines

Unfortunately, I stumbled on the following test result then.

Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_questionable_evaluation_order1.cocci …
minus: parse error:
File "show_questionable_evaluation_order1.cocci", line 9, column 1, charpos = 76
around = '...+>',
whole content = ...+>

Can the data processing be extended anyhow also for expression fragments?

Regards,
Markus

#2 lore raw
Quoted 11 lines
Quoted 9 lines

@display@
expression x, y;
@@
*(1 * x) /
...
*(2 * y) /
<+...
*(4 * x) /
...+>

You have to make a real expression.

I hope that this software limitation can reconsidered better.

Quoted 1 line

What you show is not a real expression.

This is obvious.

Can it be detected anyhow that corresponding parts are occasionally repeated?

Regards,
Markus