aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tree.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-09-15 17:33:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-09-15 17:33:57 +0000
commitfb1d9a8f6663d8c5321def7ad5c3cdab2451d965 (patch)
tree385f0454bf368402f08726471d77862edb4eae99 /tree.c
parentb399f6ed25a3a9bcf7263a89d1058879fd11ff62 (diff)
downloadmandoc-fb1d9a8f6663d8c5321def7ad5c3cdab2451d965.tar.gz
mandoc-fb1d9a8f6663d8c5321def7ad5c3cdab2451d965.tar.zst
mandoc-fb1d9a8f6663d8c5321def7ad5c3cdab2451d965.zip
For some mdoc(7) macros, it is (unfortunately) semantically significant
whether they are the first macro on the line or called by another macro. To help debugging, indicate this property "first macro on a new input line" by prefixing an asterisk to the line number in -Ttree output.
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tree.c b/tree.c
index dccbe37f..08a76b80 100644
--- a/tree.c
+++ b/tree.c
@@ -1,4 +1,4 @@
-/* $Id: tree.c,v 1.48 2013/05/18 17:08:43 schwarze Exp $ */
+/* $Id: tree.c,v 1.49 2013/09/15 17:33:57 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -159,8 +159,11 @@ print_mdoc(const struct mdoc_node *n, int indent)
if (argv[i].sz > 0)
printf(" ]");
}
-
- printf(" %d:%d\n", n->line, n->pos);
+
+ putchar(' ');
+ if (MDOC_LINE & n->flags)
+ putchar('*');
+ printf("%d:%d\n", n->line, n->pos);
}
if (n->child)