Module Name: src
Committed By: rillig
Date: Fri Jun 23 20:44:51 UTC 2023
Modified Files:
src/tests/usr.bin/indent: fmt_else_comment.c opt_bap.c
psym_switch_expr.c
Log Message:
tests/indent: fix comments
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/fmt_else_comment.c \
src/tests/usr.bin/indent/psym_switch_expr.c
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/opt_bap.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_else_comment.c
diff -u src/tests/usr.bin/indent/fmt_else_comment.c:1.5 src/tests/usr.bin/indent/fmt_else_comment.c:1.6
--- src/tests/usr.bin/indent/fmt_else_comment.c:1.5 Thu May 11 09:28:53 2023
+++ src/tests/usr.bin/indent/fmt_else_comment.c Fri Jun 23 20:44:51 2023
@@ -1,10 +1,11 @@
-/* $NetBSD: fmt_else_comment.c,v 1.5 2023/05/11 09:28:53 rillig Exp $ */
+/* $NetBSD: fmt_else_comment.c,v 1.6 2023/06/23 20:44:51 rillig Exp $ */
/*
- * Tests for comments after 'if (expr)' and 'else'. If the option '-br' is
- * given (or rather, if '-bl' is not given), indent looks ahead to the
- * following significant token to see whether it is a '{', it then moves the
- * comments after the '{'.
+ * Tests for comments after 'if (expr)' and 'else'. Before 2023-05-11, if the
+ * option '-br' was given (or rather, if '-bl' was not given), indent looked
+ * ahead to the following significant token to see whether it was a '{', it
+ * then moved the comments after the '{'. This token swapping was error-prone
+ * and thus removed.
*
* See also:
* FreeBSD r303484
@@ -12,8 +13,8 @@
*/
/*
- * The two 'if' statements below exercise two different code paths, even
- * though they look very similar.
+ * Before 2023-05-11, the two 'if' statements below exercised two different
+ * code paths, even though they look very similar.
*/
//indent input
void t(void) {
@@ -52,6 +53,7 @@ void t(void) {
/* Old indent would remove the 3 blank lines above, awaiting "else". */
+ // $ 'Old' means something before 2019.
if (1) {
int a;
@@ -68,6 +70,7 @@ void t(void) {
if (1)
;
else /* Old indent would get very confused here */
+ // $ 'Old' means something before 2019.
/* We also mustn't assume that there's only one comment */
/* before the left brace. */
{
Index: src/tests/usr.bin/indent/psym_switch_expr.c
diff -u src/tests/usr.bin/indent/psym_switch_expr.c:1.5 src/tests/usr.bin/indent/psym_switch_expr.c:1.6
--- src/tests/usr.bin/indent/psym_switch_expr.c:1.5 Tue Jun 6 04:37:27 2023
+++ src/tests/usr.bin/indent/psym_switch_expr.c Fri Jun 23 20:44:51 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: psym_switch_expr.c,v 1.5 2023/06/06 04:37:27 rillig Exp $ */
+/* $NetBSD: psym_switch_expr.c,v 1.6 2023/06/23 20:44:51 rillig Exp $ */
/*
* Tests for the parser symbol psym_switch_expr, which represents the keyword
@@ -12,7 +12,7 @@
/*
* In all practical cases, a 'switch (expr)' is followed by a block, but the
* C syntax allows an arbitrary statement. Unless such a statement has a
- * label, it is unreachable.
+ * label or is a loop, its beginning is unreachable.
*/
//indent input
void
Index: src/tests/usr.bin/indent/opt_bap.c
diff -u src/tests/usr.bin/indent/opt_bap.c:1.10 src/tests/usr.bin/indent/opt_bap.c:1.11
--- src/tests/usr.bin/indent/opt_bap.c:1.10 Fri Jun 16 11:48:32 2023
+++ src/tests/usr.bin/indent/opt_bap.c Fri Jun 23 20:44:51 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bap.c,v 1.10 2023/06/16 11:48:32 rillig Exp $ */
+/* $NetBSD: opt_bap.c,v 1.11 2023/06/23 20:44:51 rillig Exp $ */
/*
* Tests for the options '-bap' and '-nbap' ("blank line after procedure
@@ -115,7 +115,7 @@ example(void)
/*
* A preprocessing line after the end of a function body does not force a blank
- * line, as these lines are not a different syntactic layer.
+ * line, as these lines are from a different syntactic layer.
*/
//indent input
#if 0