diff options
author | Carl Worth <cworth@cworth.org> | 2010-06-02 10:48:47 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-06-02 10:57:18 -0700 |
commit | 4c22f4dba7a87de4736e01010e361b073a7501c8 (patch) | |
tree | 1d93f842e925f261eb84b61269526cb07821c54b /tests/063-comments.c | |
parent | 2571415d1a7eec72db33cd521ca48fe755c43f9c (diff) |
Fix multi-line comment regular expression to handle (non) nested comments.
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.
Diffstat (limited to 'tests/063-comments.c')
-rw-r--r-- | tests/063-comments.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/063-comments.c b/tests/063-comments.c index 4cda52236e..e641d2f0f9 100644 --- a/tests/063-comments.c +++ b/tests/063-comments.c @@ -13,3 +13,8 @@ and slashes / *** / and other stuff. ****/ more code here +/* Test that /* nested + comments */ +are not treated like comments. +/*/ this is a comment */ +/*/*/ |