[cocci] Searching for switch statements with SmPL?

Markus Elfring <[email protected]>
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hello,

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

@display@
constant c;
expression e;
statement s;
@@
(switch (e)
 {
 <+... case c: ... break; ...+>
 }
|
*switch (...) s
)


Unfortunately, I am wondering about the following information.

Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_switch_without_break2.cocci
…
minus: parse error: 
  File "show_switch_without_break2.cocci", line 8, column 1, charpos = 68
  around = '<+...',
  whole content =  <+... case c: ... break; ...+>


Under which circumstances will such data processing become better supported?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.