Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/indent indent: demonstrate disappearing form feed
details: https://anonhg.NetBSD.org/src/rev/7e46ba95be23
branches: trunk
changeset: 1024878:7e46ba95be23
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 07 18:49:02 2021 +0000
description:
indent: demonstrate disappearing form feed
diffstat:
tests/usr.bin/indent/token_form_feed.c | 27 ++++++++++++++++++++++++++-
usr.bin/indent/indent.c | 5 +++--
2 files changed, 29 insertions(+), 3 deletions(-)
diffs (64 lines):
diff -r edcd3ab1a854 -r 7e46ba95be23 tests/usr.bin/indent/token_form_feed.c
--- a/tests/usr.bin/indent/token_form_feed.c Sun Nov 07 18:38:34 2021 +0000
+++ b/tests/usr.bin/indent/token_form_feed.c Sun Nov 07 18:49:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_form_feed.c,v 1.2 2021/11/07 18:38:34 rillig Exp $ */
+/* $NetBSD: token_form_feed.c,v 1.3 2021/11/07 18:49:02 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -19,3 +19,28 @@
void function_2(void);
#indent end
+
+
+/*
+ * Test form feed after 'if (expr)', which is handled in search_stmt.
+ */
+#indent input
+void function(void)
+{
+ if (expr)
+ /* <-- form feed */
+ {
+ }
+}
+#indent end
+
+#indent run
+void
+function(void)
+{
+ if (expr) {
+ /* $ XXX: The form feed has disappeared. */
+ /* <-- form feed */
+ }
+}
+#indent end
diff -r edcd3ab1a854 -r 7e46ba95be23 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Sun Nov 07 18:38:34 2021 +0000
+++ b/usr.bin/indent/indent.c Sun Nov 07 18:49:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.216 2021/11/07 18:26:17 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.217 2021/11/07 18:49:02 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.216 2021/11/07 18:26:17 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.217 2021/11/07 18:49:02 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
#endif
@@ -475,6 +475,7 @@
search_stmt_newline(force_nl);
break;
case lsym_form_feed:
+ /* XXX: Is simply removed from the source code. */
break;
case lsym_comment:
search_stmt_comment();
Home |
Main Index |
Thread Index |
Old Index