summaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-09-26 12:55:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-09-26 12:55:16 +0000
commit9d5e490d085f403abf3542c6607bcd6f69c8d4b9 (patch)
tree8600e4bed6edb7c1dc388c8ceb06907a68a37bcd /tree.c
parentcd4599580495e7b8d149487099c19840add8d355 (diff)
downloadmandoc-9d5e490d085f403abf3542c6607bcd6f69c8d4b9.tar.gz
Show the flags MDOC_DELIMO, MDOC_DELIMC, MDOC_EOS, and MAN_EOS.
Drop the "block-" prefixes from the node type names.
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/tree.c b/tree.c
index 48be1f2b..ca3283f1 100644
--- a/tree.c
+++ b/tree.c
@@ -74,16 +74,16 @@ print_mdoc(const struct roff_node *n, int indent)
t = "block";
break;
case ROFFT_HEAD:
- t = "block-head";
+ t = "head";
break;
case ROFFT_BODY:
if (n->end)
t = "body-end";
else
- t = "block-body";
+ t = "body";
break;
case ROFFT_TAIL:
- t = "block-tail";
+ t = "tail";
break;
case ROFFT_ELEM:
t = "elem";
@@ -159,9 +159,16 @@ print_mdoc(const struct roff_node *n, int indent)
}
putchar(' ');
+ if (MDOC_DELIMO & n->flags)
+ putchar('(');
if (MDOC_LINE & n->flags)
putchar('*');
- printf("%d:%d\n", n->line, n->pos + 1);
+ printf("%d:%d", n->line, n->pos + 1);
+ if (MDOC_DELIMC & n->flags)
+ putchar(')');
+ if (MDOC_EOS & n->flags)
+ putchar('.');
+ putchar('\n');
}
if (n->eqn)
@@ -198,10 +205,10 @@ print_man(const struct roff_node *n, int indent)
t = "block";
break;
case ROFFT_HEAD:
- t = "block-head";
+ t = "head";
break;
case ROFFT_BODY:
- t = "block-body";
+ t = "body";
break;
case ROFFT_TBL:
break;
@@ -246,7 +253,10 @@ print_man(const struct roff_node *n, int indent)
printf("%s (%s) ", p, t);
if (MAN_LINE & n->flags)
putchar('*');
- printf("%d:%d\n", n->line, n->pos + 1);
+ printf("%d:%d", n->line, n->pos + 1);
+ if (MAN_EOS & n->flags)
+ putchar('.');
+ putchar('\n');
}
if (n->eqn)