On Sun, 12 May 2024, Markus Elfring wrote: > > The language is as it is. You can express various things by adding more > > or less information. > > The previous SmPL script example indicated special SmPL code design possibilities. > Thus I would like to apply such development experiences to another SmPL script variant. > > > // See also: > // qca_read_fw_build_info() > // drivers/bluetooth/btqca.c > @replacement@ > identifier exit, result; > statement s; > @@ > ... when != if (...) { ... when any result = -EILSEQ; goto exit; } There is currently no way to nest whens. julia > (if (...) > -{ > - result = -EILSEQ; > goto > - exit > + e_ilseq > ; > -} > |if (...) > { > ... when any > - result = -EILSEQ; > goto > - exit > + e_ilseq > ; > } > ) > ... > exit: > s > return result; > + > +e_ilseq: > +result = -EILSEQ; > +goto exit; > > > Test result: > Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> spatch --parse-cocci use_common_code_for_EILSEQ-4.cocci > … > minus: parse error: > File "use_common_code_for_EILSEQ-4.cocci", line 8, column 37, charpos = 162 > around = 'result', > whole content = ... when != if (...) { ... when any result = -EILSEQ; goto exit; } > > > Unfortunately, it seems that I stumble once more on questionable software limitations. > > Regards, > Markus >