From 88750dda2da444fce307d20d33700d72e7c49c7f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 27 Feb 2020 01:43:52 +0000 Subject: Introduce the concept of nodes that are semantically transparent: they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm and .Tg, and man(7) .DT and .PD. Use this concept for a variety of improved decisions in various validators and formatters. While here, * remove a few const qualifiers on struct arguments that caused trouble; * get rid of some more Yoda notation in the vicinity; * and apply some other stylistic improvements in the vicinity. I found this class of issues while considering .Tg patches from kn@. --- roff.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'roff.h') diff --git a/roff.h b/roff.h index 736b9e0f..2cf8aeae 100644 --- a/roff.h +++ b/roff.h @@ -1,4 +1,4 @@ -/* $Id: roff.h,v 1.70 2020/01/19 18:02:00 schwarze Exp $ */ +/* $Id: roff.h,v 1.71 2020/02/27 01:43:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze @@ -549,5 +549,9 @@ struct roff_meta { extern const char *const *roff_name; -int arch_valid(const char *, enum mandoc_os); -void deroff(char **, const struct roff_node *); +int arch_valid(const char *, enum mandoc_os); +void deroff(char **, const struct roff_node *); +struct roff_node *roff_node_child(struct roff_node *); +struct roff_node *roff_node_next(struct roff_node *); +struct roff_node *roff_node_prev(struct roff_node *); +int roff_node_transparent(struct roff_node *); -- cgit v1.2.3