Module Name:    src
Committed By:   rillig
Date:           Sun Oct 24 21:48:16 UTC 2021

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

Log Message:
tests/indent: test form feed in comments


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.5 src/tests/usr.bin/indent/token_comment.c:1.6
--- src/tests/usr.bin/indent/token_comment.c:1.5	Tue Oct 19 20:41:42 2021
+++ src/tests/usr.bin/indent/token_comment.c	Sun Oct 24 21:48:16 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token_comment.c,v 1.5 2021/10/19 20:41:42 rillig Exp $ */
+/* $NetBSD: token_comment.c,v 1.6 2021/10/24 21:48:16 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -678,3 +678,39 @@ int		decl;
 // end-of-line comment at the end of the file
 #indent end
 #indent run-equals-input
+
+
+/* A form feed in the middle of a comment is an ordinary character. */
+#indent input
+/*
+ * AE
+ */
+/*-AE*/
+#indent end
+#indent run-equals-input
+
+/*
+ * At the beginning of a block comment or after a '*', '\f' is special. This
+ * is an implementation detail that should not be visible from the outside.
+ * Form feeds in comments are seldom used though, so this is no problem.
+ */
+#indent input
+/* comment*/
+/*text* comment*/
+#indent end
+
+#indent run
+/* * comment */
+/* text* * comment */
+#indent end
+
+/*
+ * Without 'star_comment_cont', there is no separator between the form feed
+ * and the surrounding text.
+ */
+#indent run -nsc
+/*comment */
+/* text*comment */
+#indent end
+
+#indent run-equals-input -nfc1

Reply via email to