Discussion:
[Cocci] a small nuisance report
Robert Larice
2018-04-29 13:14:24 UTC
Permalink
Hello,

attached is a small example which
injects a statement and a comment.

It works well, but does'nt do exactly as wanted.

I get :

+ j /* comments are overrated */
+ -= 3;

The comment popped up within the expression instead
of in front of it.
no bug, but uggly.

Regards,
Robert
Julia Lawall
2018-04-29 13:29:11 UTC
Permalink
Post by Robert Larice
Hello,
attached is a small example which
injects a statement and a comment.
It works well, but does'nt do exactly as wanted.
+ j /* comments are overrated */
+ -= 3;
The comment popped up within the expression instead
of in front of it.
no bug, but uggly.
Indeed, it should not be there.

julia
Post by Robert Larice
Regards,
Robert
Julia Lawall
2018-04-29 17:56:28 UTC
Permalink
Post by Robert Larice
Hello,
attached is a small example which
injects a statement and a comment.
It works well, but does'nt do exactly as wanted.
+ j /* comments are overrated */
+ -= 3;
The comment popped up within the expression instead
of in front of it.
no bug, but uggly.
This problem is solve in the github version of Coccinelle. The problem
was because j was declared as a symbol.

julia
Robert Larice
2018-04-29 18:10:07 UTC
Permalink
Post by Julia Lawall
Post by Robert Larice
Hello,
attached is a small example which
injects a statement and a comment.
It works well, but does'nt do exactly as wanted.
+ j /* comments are overrated */
+ -= 3;
The comment popped up within the expression instead
of in front of it.
no bug, but uggly.
This problem is solve in the github version of Coccinelle. The problem
was because j was declared as a symbol.
julia
Thank You,

so I could work around by simply using an "identifier"
perhaps augmented with a regexp match.

Best Regards,
Robert
Julia Lawall
2018-04-29 18:30:10 UTC
Permalink
Post by Robert Larice
Post by Julia Lawall
Post by Robert Larice
Hello,
attached is a small example which
injects a statement and a comment.
It works well, but does'nt do exactly as wanted.
+ j /* comments are overrated */
+ -= 3;
The comment popped up within the expression instead
of in front of it.
no bug, but uggly.
This problem is solve in the github version of Coccinelle. The problem
was because j was declared as a symbol.
julia
Thank You,
so I could work around by simply using an "identifier"
perhaps augmented with a regexp match.
No, just pull from github and recompile.

julia
Robert Larice
2018-04-29 19:10:40 UTC
Permalink
Post by Julia Lawall
Post by Robert Larice
Post by Julia Lawall
Post by Robert Larice
Hello,
attached is a small example which
injects a statement and a comment.
It works well, but does'nt do exactly as wanted.
+ j /* comments are overrated */
+ -= 3;
The comment popped up within the expression instead
of in front of it.
no bug, but uggly.
This problem is solve in the github version of Coccinelle. The problem
was because j was declared as a symbol.
julia
Thank You,
so I could work around by simply using an "identifier"
perhaps augmented with a regexp match.
No, just pull from github and recompile.
julia
just did, and it just works,
Thanks,
Robert

Continue reading on narkive:
Loading...