Discussion:
[Cocci] Addition of a data type property with SmPL
SF Markus Elfring
2018-06-10 08:22:08 UTC
Permalink
Hello,

I would like to try another source code transformation out with the help of
the semantic patch language.

@addition@
identifier var;
type T;
@@
T
+const
* var;


***@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci add_const3.cocci
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
plus: parse error:
File "add_const3.cocci", line 6, column 1, charpos = 42
around = 'const',
whole content = +const


* How do you think about this test result?

* Can the addition of such a data type property be generally avoided
if it would be present already?

https://github.com/coccinelle/coccinelle/issues/49

Regards,
Markus
Julia Lawall
2018-06-10 08:30:08 UTC
Permalink
Post by SF Markus Elfring
Hello,
I would like to try another source code transformation out with the help of
the semantic patch language.
@addition@
identifier var;
type T;
@@
T
+const
* var;
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
File "add_const3.cocci", line 6, column 1, charpos = 42
around = 'const',
whole content = +const
* How do you think about this test result?
Complex types are not supported entirely correctly in SmPL.
Post by SF Markus Elfring
* Can the addition of such a data type property be generally avoided
if it would be present already?
If you put disable optional_qualifier in the initial @@ a pattern that
does not contain const will not match code that contains const.

julia
Post by SF Markus Elfring
https://github.com/coccinelle/coccinelle/issues/49
Regards,
Markus
_______________________________________________
Cocci mailing list
https://systeme.lip6.fr/mailman/listinfo/cocci
Loading...