Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/indent tests/indent: demonstrate more example ...



details:   https://anonhg.NetBSD.org/src/rev/23e93681ca6f
branches:  trunk
changeset: 1026463:23e93681ca6f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Nov 25 18:20:21 2021 +0000

description:
tests/indent: demonstrate more example for broken '*' in declarations

Since indent-2021.11.25.16.41.33.

diffstat:

 tests/usr.bin/indent/fmt_decl.c |  36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r 41eddb6c5cca -r 23e93681ca6f tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Thu Nov 25 18:10:23 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Thu Nov 25 18:20:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.27 2021/11/25 17:10:53 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.28 2021/11/25 18:20:21 rillig Exp $     */
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /*
@@ -789,3 +789,37 @@
 #indent end
 
 #indent run-equals-input -di0
+
+
+/*
+ * In declarations, most occurrences of '*' are pointer type derivations.
+ * There are a few exceptions though.
+ *
+ * Broken since lexi.c 1.156 from 2021-11-25.
+ */
+#indent input
+char str[expr * expr];
+char str[expr**ptr];
+char str[*ptr**ptr];
+char str[sizeof(expr * expr)];
+char str[sizeof(int) * expr];
+char str[sizeof(*ptr)];
+char str[sizeof(type**)];
+char str[sizeof(**ptr)];
+#indent end
+
+#indent run -di0
+/* $ FIXME: The '*' must be a binary operator. */
+char str[expr *expr];
+/* $ FIXME: The first '*' must be a binary operator. */
+char str[expr **ptr];
+/* $ FIXME: The second '*' must be a binary operator. */
+char str[*ptr **ptr];
+/* $ FIXME: The '*' must be a binary operator. */
+char str[sizeof(expr *expr)];
+/* $ FIXME: The '*' must be a binary operator. */
+char str[sizeof(int) *expr];
+char str[sizeof(*ptr)];
+char str[sizeof(type **)];
+char str[sizeof(**ptr)];
+#indent end



Home | Main Index | Thread Index | Old Index