Module Name:    src
Committed By:   rillig
Date:           Tue Jan  5 17:13:44 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: scan.l

Log Message:
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".


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/xlint/lint1/scan.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.112 src/usr.bin/xlint/lint1/scan.l:1.113
--- src/usr.bin/xlint/lint1/scan.l:1.112	Mon Jan  4 22:26:50 2021
+++ src/usr.bin/xlint/lint1/scan.l	Tue Jan  5 17:13:44 2021
@@ -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 @@ incline(void)
 {
 	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;

Reply via email to