Tue Jan 5 17:13:44 2021 UTC ()
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".


(rillig)
diff -r1.112 -r1.113 src/usr.bin/xlint/lint1/scan.l

cvs diff -r1.112 -r1.113 src/usr.bin/xlint/lint1/scan.l (expand / switch to context diff)
--- src/usr.bin/xlint/lint1/scan.l 2021/01/04 22:26:50 1.112
+++ src/usr.bin/xlint/lint1/scan.l 2021/01/05 17:13:44 1.113
@@ -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;