Module Name:    src
Committed By:   rillig
Date:           Sun Oct 31 10:56:19 UTC 2021

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

Log Message:
tests/indent: document that 'void' is not always parsed as a type


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/fmt_decl.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/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.7 src/tests/usr.bin/indent/fmt_decl.c:1.8
--- src/tests/usr.bin/indent/fmt_decl.c:1.7	Sat Oct 30 11:41:49 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 10:56:19 2021
@@ -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 @@ typedef struct Complex {
 #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,

Reply via email to