=================================================================== RCS file: /cvs/mandoc/tree.c,v retrieving revision 1.76 retrieving revision 1.79 diff -u -p -r1.76 -r1.79 --- mandoc/tree.c 2017/07/07 19:39:30 1.76 +++ mandoc/tree.c 2018/08/14 01:27:48 1.79 @@ -1,7 +1,7 @@ -/* $Id: tree.c,v 1.76 2017/07/07 19:39:30 schwarze Exp $ */ +/* $Id: tree.c,v 1.79 2018/08/14 01:27:48 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons - * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze + * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -115,6 +115,9 @@ print_mdoc(const struct roff_node *n, int indent) case ROFFT_TEXT: t = "text"; break; + case ROFFT_COMMENT: + t = "comment"; + break; case ROFFT_TBL: break; case ROFFT_EQN: @@ -126,6 +129,7 @@ print_mdoc(const struct roff_node *n, int indent) switch (n->type) { case ROFFT_TEXT: + case ROFFT_COMMENT: p = n->string; break; case ROFFT_BODY: @@ -202,7 +206,7 @@ print_mdoc(const struct roff_node *n, int indent) } if (n->eqn) - print_box(n->eqn->root->first, indent + 4); + print_box(n->eqn->first, indent + 4); if (n->child) print_mdoc(n->child, indent + (n->type == ROFFT_BLOCK ? 2 : 4)); @@ -231,6 +235,9 @@ print_man(const struct roff_node *n, int indent) case ROFFT_TEXT: t = "text"; break; + case ROFFT_COMMENT: + t = "comment"; + break; case ROFFT_BLOCK: t = "block"; break; @@ -251,6 +258,7 @@ print_man(const struct roff_node *n, int indent) switch (n->type) { case ROFFT_TEXT: + case ROFFT_COMMENT: p = n->string; break; case ROFFT_ELEM: @@ -281,13 +289,15 @@ print_man(const struct roff_node *n, int indent) if (NODE_LINE & n->flags) putchar('*'); printf("%d:%d", n->line, n->pos + 1); + if (NODE_DELIMC & n->flags) + putchar(')'); if (NODE_EOS & n->flags) putchar('.'); putchar('\n'); } if (n->eqn) - print_box(n->eqn->root->first, indent + 4); + print_box(n->eqn->first, indent + 4); if (n->child) print_man(n->child, indent + (n->type == ROFFT_BLOCK ? 2 : 4));