Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: in debug mode, log every newline



details:   https://anonhg.NetBSD.org/src/rev/3ecfe30f47b8
branches:  trunk
changeset: 949220:3ecfe30f47b8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jan 05 17:13:44 2021 +0000

description:
lint: in debug mode, log every newline

This helps to quickly see where in the source file the parser currently
is.  Previously, the parsing position was only printed after each
declaration, as part of "clear flags".

diffstat:

 usr.bin/xlint/lint1/scan.l |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 6a08877e262a -r 3ecfe30f47b8 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Tue Jan 05 16:34:37 2021 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Tue Jan 05 17:13:44 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.112 2021/01/04 22:26:50 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.113 2021/01/05 17:13:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.112 2021/01/04 22:26:50 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.113 2021/01/05 17:13:44 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -175,6 +175,9 @@
 {
        curr_pos.p_line++;
        curr_pos.p_uniq = 0;
+#ifdef DEBUG
+       printf("parsing %s:%d\n", curr_pos.p_file, curr_pos.p_line);
+#endif
        if (curr_pos.p_file == csrc_pos.p_file) {
                csrc_pos.p_line++;
                csrc_pos.p_uniq = 0;



Home | Main Index | Thread Index | Old Index