diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-09-26 12:54:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-09-26 12:54:19 +0000 |
commit | 79dd88da372398a473efba97aca5b86e6249f7be (patch) | |
tree | ba981192e7f72d684623d8b48be063cc64297ebf /usr.bin/mandoc | |
parent | eb9889ae7bdf7b2c58943a9a96d5b9a9e4ae88ff (diff) |
Show the flags MDOC_DELIMO, MDOC_DELIMC, MDOC_EOS, and MAN_EOS.
Drop the "block-" prefixes from the node type names.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/tree.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/usr.bin/mandoc/tree.c b/usr.bin/mandoc/tree.c index 0d34e4d47dd..0d04e4352d3 100644 --- a/usr.bin/mandoc/tree.c +++ b/usr.bin/mandoc/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.34 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: tree.c,v 1.35 2015/09/26 12:54:18 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -72,16 +72,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"; @@ -157,9 +157,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) @@ -196,10 +203,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; @@ -244,7 +251,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) |