Module Name:    src
Committed By:   rillig
Date:           Sat Jun 10 07:05:18 UTC 2023

Modified Files:
        src/tests/usr.bin/indent: lsym_case_label.c
        src/usr.bin/indent: debug.c

Log Message:
indent: explain right-aligned code


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/lsym_case_label.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/indent/debug.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/lsym_case_label.c
diff -u src/tests/usr.bin/indent/lsym_case_label.c:1.9 src/tests/usr.bin/indent/lsym_case_label.c:1.10
--- src/tests/usr.bin/indent/lsym_case_label.c:1.9	Sat Jun 10 06:52:35 2023
+++ src/tests/usr.bin/indent/lsym_case_label.c	Sat Jun 10 07:05:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_case_label.c,v 1.9 2023/06/10 06:52:35 rillig Exp $ */
+/* $NetBSD: lsym_case_label.c,v 1.10 2023/06/10 07:05:18 rillig Exp $ */
 
 /*
  * Tests for the tokens lsym_case and lsym_default, which represent the
@@ -92,10 +92,12 @@ const char *type_name = _Generic(
 // $ XXX: It's strange to align the arguments at the parenthesis even though
 // $ XXX: the first argument is already on a separate line.
 				 ' ',
+// $ The indentation is so large that the strings would spill over the right
+// $ margin.  To prevent that, the code is right-aligned.  Since the base
+// $ indentation of this declaration is 0, the code might even start at the
+// $ beginning of the line.
 				 int: "character constants have type 'int'",
-// $ FIXME: The indentation is not sensible in any way.
 			       char: "character constants have type 'char'",
-// $ FIXME: The indentation is not sensible in any way.
 			 default: "character constants have some other type"
 );
 //indent end

Index: src/usr.bin/indent/debug.c
diff -u src/usr.bin/indent/debug.c:1.44 src/usr.bin/indent/debug.c:1.45
--- src/usr.bin/indent/debug.c:1.44	Sat Jun 10 06:38:20 2023
+++ src/usr.bin/indent/debug.c	Sat Jun 10 07:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.44 2023/06/10 06:38:20 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.45 2023/06/10 07:05:18 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: debug.c,v 1.44 2023/06/10 06:38:20 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.45 2023/06/10 07:05:18 rillig Exp $");
 
 #include <stdarg.h>
 
@@ -62,7 +62,7 @@ const char *const lsym_name[] = {
 	"postfix_op",
 	"binary_op",
 	"question",
-	"'?:' colon",
+	"question_colon",
 	"comma",
 	"typedef",
 	"modifier",
@@ -71,8 +71,8 @@ const char *const lsym_name[] = {
 	"type_in_parentheses",
 	"word",
 	"funcname",
-	"label colon",
-	"other colon",
+	"label_colon",
+	"other_colon",
 	"semicolon",
 	"case",
 	"default",

Reply via email to