diff options
-rw-r--r-- | glcpp-lex.l | 2 | ||||
-rw-r--r-- | tests/063-comments.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l index 0954ab7e83..7bc5fab76d 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -53,7 +53,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } /* Multi-line comments */ -[/][*]([^*]*[*]+[^/])*[^*]*[*]*[/] { +[/][*]([^*]*[*]+[^*/])*[^*]*[*]+[/] { if (yyextra->space_tokens) return SPACE; } 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 */ +/*/*/ |