Module Name:    src
Committed By:   rillig
Date:           Thu Nov  4 18:31:23 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: token_comment.c

Log Message:
tests/indent: demonstrate wrong edge case in C99 comments


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/usr.bin/indent/token_comment.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/token_comment.c
diff -u src/tests/usr.bin/indent/token_comment.c:1.15 src/tests/usr.bin/indent/token_comment.c:1.16
--- src/tests/usr.bin/indent/token_comment.c:1.15	Sat Oct 30 22:36:07 2021
+++ src/tests/usr.bin/indent/token_comment.c	Thu Nov  4 18:31:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token_comment.c,v 1.15 2021/10/30 22:36:07 rillig Exp $ */
+/* $NetBSD: token_comment.c,v 1.16 2021/11/04 18:31:22 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -948,3 +948,20 @@ f(void)
 		 /* 12 1234 123 123456 1234 1234567 123 1234.  */ ;
 }
 #indent end
+
+
+/*
+ * Test for an edge cases in comment handling, having a block comment inside
+ * a line comment.
+ */
+#indent input
+/* block comment */
+// line comment /* still a line comment */ still a line comment
+#indent end
+
+/* FIXME: The line comment must not be indented. */
+/* FIXME: The '*' '/' in the line comment must not be removed. */
+#indent run
+/* block comment */
+ // line comment /* still a line comment  still a line comment
+#indent end

Reply via email to