Checking a parse error for detailed SmPL rule properties
Hello,
I am trying the following tiny script variant for the semantic patch language out also together with the software combination “Coccinelle 1.1.1-00630-gdeb429df”.
virtual report, org
@or depends on org || report disable sizeof_type_expr@ position p;
@@
my_action@p(...)
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci or-test2-20240124.cocci …
rule name: parse error:
File "or-test2-20240124.cocci", line 3, column 1, charpos = 22
around = 'or',
whole content = @or depends on org || report disable sizeof_type_expr@
Now I wonder how this software behaviour would fit to the documentation.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/5fdb1a247d3374ac30a3e565b2cc5167aeefc4e5/docs/manual/cocci_syntax.tex#L87
May SmPL rule identifiers be chosen freely?
Regards,
Markus
Quoted 22 lines · Markus Elfring
Hello,
I am trying the following tiny script variant for the semantic patch language out also together with the software combination “Coccinelle 1.1.1-00630-gdeb429df”.
virtual report, org
@or depends on org || report disable sizeof_type_expr@ position p;
@@
my_action@p(...)Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci
or-test2-20240124.cocci…
rule name: parse error:
File "or-test2-20240124.cocci", line 3, column 1, charpos = 22
around = 'or',
whole content = @or depends on org || report disable sizeof_type_expr@
Quoted 4 lines
Now I wonder how this software behaviour would fit to the documentation.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/5fdb1a247d3374ac30a3e565b2cc5167aeefc4e5/docs/manual/cocci_syntax.tex#L87May SmPL rule identifiers be chosen freely?
It seems that they should not be keywords.
julia
Quoted 3 lines
Quoted 1 line
May SmPL rule identifiers be chosen freely?
It seems that they should not be keywords.
Should such SmPL identifiers be independent from an applied programming language like OCaml?
Regards,
Markus
Quoted 6 lines · Markus Elfring
Quoted 3 lines
Quoted 1 line
May SmPL rule identifiers be chosen freely?
It seems that they should not be keywords.
Should such SmPL identifiers be independent from an applied programming language like OCaml?
It has nothing to do with OCaml. or is an alternative form of || in C.
https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
julia
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
May SmPL rule identifiers be chosen freely?
It seems that they should not be keywords.
Should such SmPL identifiers be independent from an applied programming language like OCaml?
It has nothing to do with OCaml. or is an alternative form of || in C.
Why would such a technical aspect influence the identifier selection within the name space of a rule for the semantic patch language?
Regards,
Markus
Quoted 11 lines · Markus Elfring
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
May SmPL rule identifiers be chosen freely?
It seems that they should not be keywords.
Should such SmPL identifiers be independent from an applied programming language like OCaml?
It has nothing to do with OCaml. or is an alternative form of || in C.
Why would such a technical aspect influence the identifier selection within the name space of a rule for the semantic patch language?
Because or is now a keyword, and we don't allow keywords as rule names. You can't have if or while as a rule name either.
Perhaps it could be fixed, but that is the explanation.
julia
Quoted 7 lines
Quoted 2 lines
Why would such a technical aspect influence the identifier selection within the name space of a rule for the semantic patch language?
Because or is now a keyword, and we don't allow keywords as rule names. You can't have if or while as a rule name either.
Perhaps it could be fixed, but that is the explanation.
With which commit was the observed restriction introduced?
Regards,
Markus
Quoted 9 lines · Markus Elfring
Quoted 7 lines
Quoted 2 lines
Why would such a technical aspect influence the identifier selection within the name space of a rule for the semantic patch language?
Because or is now a keyword, and we don't allow keywords as rule names. You can't have if or while as a rule name either.
Perhaps it could be fixed, but that is the explanation.
With which commit was the observed restriction introduced?
Probably e9facdc383d75bc2910762d166810ea6f858e8e5
julia
Quoted 4 lines
Regards,
Markus
Quoted 3 lines
Quoted 1 line
With which commit was the observed restriction introduced?
Probably …
I am curious then how the software evolution will be reconsidered also according to this contribution.
https://gitlab.inria.fr/coccinelle/coccinelle/-/commit/e9facdc383d75bc2910762d166810ea6f858e8e5
completing alternative names; supported for both C and C++ 2023-12-17
Regards,
Markus