=================================================================== RCS file: /cvs/mandoc/tree.c,v retrieving revision 1.85 retrieving revision 1.88 diff -u -p -r1.85 -r1.88 --- mandoc/tree.c 2020/01/11 16:03:42 1.85 +++ mandoc/tree.c 2020/04/07 22:56:02 1.88 @@ -1,7 +1,7 @@ -/* $Id: tree.c,v 1.85 2020/01/11 16:03:42 schwarze Exp $ */ +/* $Id: tree.c,v 1.88 2020/04/07 22:56:02 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze + * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,6 +14,9 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Formatting module to let mandoc(1) show + * a human readable representation of the syntax tree. */ #include "config.h" @@ -199,6 +202,16 @@ print_mdoc(const struct roff_node *n, int indent) putchar(')'); if (n->flags & NODE_EOS) putchar('.'); + if (n->flags & NODE_ID) { + printf(" ID"); + if (n->string != NULL) + printf("=%s", n->string); + } + if (n->flags & NODE_HREF) { + printf(" HREF"); + if (n->string != NULL && (n->flags & NODE_ID) == 0) + printf("=%s", n->string); + } if (n->flags & NODE_BROKEN) printf(" BROKEN"); if (n->flags & NODE_NOFILL) @@ -298,6 +311,11 @@ print_man(const struct roff_node *n, int indent) putchar(')'); if (n->flags & NODE_EOS) putchar('.'); + if (n->flags & NODE_ID) { + printf(" ID"); + if (n->string != NULL) + printf("=%s", n->string); + } if (n->flags & NODE_NOFILL) printf(" NOFILL"); putchar('\n');