diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-30 00:49:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-30 00:49:54 +0000 |
commit | 0cd2663fe9e76ba0ad357a566dc3416eccab70e5 (patch) | |
tree | bdd4ce48b3029984474e5d53e3fdbca949b317c9 /mdoc_validate.c | |
parent | cf618db57fee5de46ee351c83eeb03292758f546 (diff) | |
download | mandoc-0cd2663fe9e76ba0ad357a566dc3416eccab70e5.tar.gz |
Cleanup, no functional change:
The struct roff_man used to be a bad mixture of internal parser
state and public parsing results. Move the public results to the
parsing result struct roff_meta, which is already public. Move the
rest of struct roff_man to the parser-internal header roff_int.h.
Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.
This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 535996eb..29a4da6c 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1952,7 +1952,7 @@ post_root(POST_ARGS) while (*arch != NULL && strcmp(*arch, mdoc->meta.arch)) arch++; if (*arch == NULL) { - n = mdoc->first->child; + n = mdoc->meta.first->child; while (n->tok != MDOC_Dt || n->child == NULL || n->child->next == NULL || @@ -1968,7 +1968,7 @@ post_root(POST_ARGS) /* Check that we begin with a proper `Sh'. */ - n = mdoc->first->child; + n = mdoc->meta.first->child; while (n != NULL && (n->type == ROFFT_COMMENT || (n->tok >= MDOC_Dd && |