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 logging for enum token clas...



details:   https://anonhg.NetBSD.org/src/rev/1df7cf61766b
branches:  trunk
changeset: 374824:1df7cf61766b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat May 13 13:45:24 2023 +0000

description:
indent: add debug logging for enum token classification

diffstat:

 usr.bin/indent/debug.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r d74ffcde8b15 -r 1df7cf61766b usr.bin/indent/debug.c
--- a/usr.bin/indent/debug.c    Sat May 13 13:43:25 2023 +0000
+++ b/usr.bin/indent/debug.c    Sat May 13 13:45:24 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: debug.c,v 1.1 2023/05/13 09:27:49 rillig Exp $ */
+/*     $NetBSD: debug.c,v 1.2 2023/05/13 13:45:24 rillig Exp $ */
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: debug.c,v 1.1 2023/05/13 09:27:49 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.2 2023/05/13 13:45:24 rillig Exp $");
 
 #include "indent.h"
 
@@ -90,6 +90,13 @@ const char *const psym_name[] = {
     "while_expr",
 };
 
+static const char *in_enum_name[] = {
+    "no",
+    "enum",
+    "type",
+    "brace",
+};
+
 static bool debug_full_parser_state = true;
 
 static void
@@ -212,7 +219,7 @@ debug_parser_state(lexer_symbol lsym)
     debug_ps_bool(in_decl);
     debug_ps_int(just_saw_decl);
     debug_ps_bool(in_func_def_params);
-    // No debug output for in_enum.
+    debug_ps_enum(in_enum, in_enum_name);
     debug_ps_bool(decl_indent_done);
     debug_ps_int(decl_ind);
     // No debug output for di_stack.



Home | Main Index | Thread Index | Old Index