Skip Menu |

This queue is for tickets about the Regexp-Common CPAN distribution.

Report information
The Basics
Id: 77702
Status: resolved
Priority: 0/
Queue: Regexp-Common

People
Owner: Nobody in particular
Requestors: davido [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
That /\G.*?$RE{comment}{C}/ is not a good C parser is not a bug in $RE{comment}{C}. $RE{comment}{C} will match a comment, but it's up to you to only look where a comment can be found.
This is not a bug. Regexp::Common gives patterns, not parsers.