4c22f4dba7
Ken reminded me of a couple cases that I should be testing. These are the non-nestedness of things that look like nested comments as well as potentially tricky things like "/*/" and "/*/*/". The (non) nested comment case was not working in the case of the comment terminator with multiple '*' characters. We fix this by not considering a '*' as the "non-slash" to terminate a sequence of '*' characters within the comment. We also fix the final match of the terminator to use '+' rather than '*' to require the presence of a final '*' character in the comment terminator.
21 lines
303 B
C
21 lines
303 B
C
/* this is a comment */
|
|
// so is this
|
|
// */
|
|
f = g/**//h;
|
|
/*//*/l();
|
|
m = n//**/o
|
|
+ p;
|
|
/* this
|
|
comment spans
|
|
multiple lines and
|
|
contains *** stars
|
|
and slashes / *** /
|
|
and other stuff.
|
|
****/
|
|
more code here
|
|
/* Test that /* nested
|
|
comments */
|
|
are not treated like comments.
|
|
/*/ this is a comment */
|
|
/*/*/
|