Skip to contentSkip to conversation

Adjusting source code behind “default:” with SmPL?

cocci Markus Elfring 1 participant 1 message Sep 30, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

I would appreciate if another source code transformation can be achieved also by the means of the semantic patch language.
Thus I tried the following SmPL script variant out.

@addition@
@@
default:
+special_action:
my_action("Hello!");

Unfortunately, I was disturbed by the following information.

Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> /usr/bin/spatch --parse-cocci add_label_behind_default.cocci …
minus: parse error:
File "add_label_behind_default.cocci", line 3, column 1, charpos = 15
around = 'default',
whole content = default:

Under which circumstances will such data processing become better supported?

Regards,
Markus