From f313579fbb5a5318367521793dc24d2567da2fde Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 10 Jan 2017 12:53:07 +0000 Subject: Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes. Use them to mark generated nodes and nodes that shall not produce output. Let -Ttree output mode display these new flags. Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments. Use NODE_NOPRT for .Dd, .Dt, and .Os. These will help to make handling of text production macros more rigorous. --- tree.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 52ca7547..2e85727b 100644 --- a/tree.c +++ b/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.69 2015/10/12 00:08:16 schwarze Exp $ */ +/* $Id: tree.c,v 1.70 2017/01/10 12:53:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -168,6 +168,10 @@ print_mdoc(const struct roff_node *n, int indent) putchar(')'); if (MDOC_EOS & n->flags) putchar('.'); + if (NODE_NOSRC & n->flags) + printf(" NOSRC"); + if (NODE_NOPRT & n->flags) + printf(" NOPRT"); putchar('\n'); } -- cgit v1.2.3