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: do not output token in debug mode



details:   https://anonhg.NetBSD.org/src/rev/df4627549645
branches:  trunk
changeset: 1024483:df4627549645
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 25 20:32:38 2021 +0000

description:
indent: do not output token in debug mode

When the parse stack is manipulated, the text of the token is not
relevant anymore and may even be confusing, for example when parsing
if_expr, the token may contain "}".

diffstat:

 usr.bin/indent/parse.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 126d8de8f79b -r df4627549645 usr.bin/indent/parse.c
--- a/usr.bin/indent/parse.c    Mon Oct 25 20:16:16 2021 +0000
+++ b/usr.bin/indent/parse.c    Mon Oct 25 20:32:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.40 2021/10/25 19:56:03 rillig Exp $        */
+/*     $NetBSD: parse.c,v 1.41 2021/10/25 20:32:38 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -57,7 +57,7 @@
 static void reduce(void);
 
 #ifdef debug
-const char *
+static const char *
 psym_name(parser_symbol psym)
 {
     static const char *const name[] = {
@@ -91,8 +91,7 @@
 void
 parse(parser_symbol psym)
 {
-    debug_println("parse token: '%s' \"%s\"",
-       psym_name(psym), token.s);
+    debug_println("parse token: '%s'", psym_name(psym));
 
     if (psym != psym_else) {
        while (ps.s_sym[ps.tos] == psym_if_expr_stmt) {



Home | Main Index | Thread Index | Old Index