summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glcpp-lex.l2
-rw-r--r--tests/063-comments.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l
index 0954ab7..7bc5fab 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 4cda522..e641d2f 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 */
+/*/*/