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: document that 'void' is n...
details: https://anonhg.NetBSD.org/src/rev/ac72ccf5bd24
branches: trunk
changeset: 990618:ac72ccf5bd24
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 31 10:56:19 2021 +0000
description:
tests/indent: document that 'void' is not always parsed as a type
diffstat:
tests/usr.bin/indent/fmt_decl.c | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diffs (50 lines):
diff -r 848c69b089ee -r ac72ccf5bd24 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c Sun Oct 31 10:47:18 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c Sun Oct 31 10:56:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_decl.c,v 1.7 2021/10/30 11:41:49 rillig Exp $ */
+/* $NetBSD: fmt_decl.c,v 1.8 2021/10/31 10:56:19 rillig Exp $ */
/* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
/* See FreeBSD r303570 */
@@ -58,6 +58,40 @@
#indent end
+/*
+ * As of 2021-10-31, indent parses the following function definition as these
+ * tokens:
+ *
+ * line 1: type "void"
+ * line 1: newline "\n"
+ * line 2: funcname "t1"
+ * line 2: newline "\n" repeated, see search_stmt
+ * line 3: funcname "t1" XXX: wrong line_no
+ * line 3: lparen_or_lbracket "("
+ * line 3: ident "char" XXX: should be 'type', intuitively
+ * line 3: unary_op "*"
+ * line 3: ident "a"
+ * line 3: comma ","
+ * line 3: ident "int" XXX: should be 'type'
+ * line 3: ident "b"
+ * line 3: comma ","
+ * line 3: newline "\n"
+ * line 4: ident "void" XXX: should be 'type'
+ * line 4: lparen_or_lbracket "("
+ * line 4: unary_op "*"
+ * line 4: ident "fn"
+ * line 4: rparen_or_rbracket ")"
+ * line 4: lparen_or_lbracket "("
+ * line 4: ident "void" XXX: should be 'type'
+ * line 4: rparen_or_rbracket ")"
+ * line 4: rparen_or_rbracket ")"
+ * line 4: newline "\n"
+ * line 5: lbrace "{"
+ * line 5: lbrace "{" repeated, see search_stmt
+ * line 5: newline "\n" FIXME: there is no newline in the source
+ * line 6: rbrace "}"
+ * line 6: eof "\n"
+ */
#indent input
void
t1 (char *a, int b,
Home |
Main Index |
Thread Index |
Old Index