Checking data processing for parentheses in SmPL scripts
Hello,
The following change specification gets accepted by the Coccinelle software.
@@
expression X;
@@
-((X-1)&X) == 0
+powerof2(X)
I got into the development mood to try another code variant out for the semantic patch language.
@adjustment@
expression X;
@@
+powerof2(
-(X-1)&
X)
- == 0
Unfortunately, the error message “unexpected close parenthesis in line 6” is reported then.
Can an other change variation make sense finally?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 2 lines
Unfortunately, the error message “unexpected close parenthesis in line 6” is reported then.
The following change specification gets accepted by the Coccinelle software.
@adjustment@
expression X;
@@
+powerof2
(
-(X-1)&
X)
- == 0
Would you like to discuss similar SmPL code variations any more?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 15 lines · Markus Elfring
Quoted 2 lines
Unfortunately, the error message “unexpected close parenthesis in line 6” is reported then.
The following change specification gets accepted by the Coccinelle software.
@adjustment@
expression X;
@@(quoted diff) +1
-2+powerof2 ( -(X-1)& X) - == 0
Quoted 1 line
Would you like to discuss similar SmPL code variations any more?
What is the question, exactly? Is there any reason why you would not expect the above code to be accepted?
julia
Quoted 8 lines
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 1 line
What is the question, exactly?
I became curious to clarify consequences around the error message “unexpected close parenthesis in line 6” for the other SmPL code variant from yesterday.
Is the Coccinelle software looking for pairs of parentheses?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 6 lines · Markus Elfring
Quoted 1 line
What is the question, exactly?
I became curious to clarify consequences around the error message “unexpected close parenthesis in line 6” for the other SmPL code variant from yesterday.
Is the Coccinelle software looking for pairs of parentheses?
It looks for a ( in column 0 and a matching ) that is not in column 0. In your example there was no ( or ) in column 0, so the message is not relevant.
julia
Quoted 4 lines
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci