Subject: | $RE{comment}{C} doesn't properly handle // c++ style with /* start token embedded. |
Consider the following valid C code:
int main(void) {
/* C style comment: OK */
int x = 0; // set x to 0 /* NOT a C style comment.
int y = 1;
return 1;
}
/* Another C style comment. */
Now some Perl code:
s/$RE{comment}{C}//sg;
What do we get?
int main(void) {
int x = 0; // set x to 0
...because the /* embedded in the // comment is seen as starting a C
style comment.