Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/indent indent: add debug output for remaining member...



details:   https://anonhg.NetBSD.org/src/rev/c30ebcd67499
branches:  trunk
changeset: 1024797:c30ebcd67499
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Nov 05 21:08:04 2021 +0000

description:
indent: add debug output for remaining members of parser_status

diffstat:

 usr.bin/indent/lexi.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 300151434ead -r c30ebcd67499 usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Fri Nov 05 19:42:48 2021 +0000
+++ b/usr.bin/indent/lexi.c     Fri Nov 05 21:08:04 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.130 2021/11/05 19:33:28 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.131 2021/11/05 21:08:04 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.130 2021/11/05 19:33:28 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.131 2021/11/05 21:08:04 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -297,11 +297,17 @@
     debug_ps_bool(next_col_1);
     debug_ps_bool(curr_col_1);
     debug_ps_bool(next_unary);
-    // procname
+    if (strcmp(ps.procname, prev_ps.procname) != 0)
+       debug_println("    ps.procname = '%s'", ps.procname);
     debug_ps_bool(want_blank);
     debug_ps_int(paren_level);
     debug_ps_int(p_l_follow);
-    // paren_indents
+    if (ps.paren_level != prev_ps.paren_level) {
+       debug_printf("    ps.paren_indents:");
+       for (int i = 0; i < ps.paren_level; i++)
+           debug_printf(" %d", ps.paren_indents[i]);
+       debug_println("");
+    }
     debug_ps_int(cast_mask);
     debug_ps_int(not_cast_mask);
 



Home | Main Index | Thread Index | Old Index