diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-30 22:56:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-30 22:56:02 +0000 |
commit | 3bc2083f7ee493642602f9dcee0f82ecbcca4c85 (patch) | |
tree | dcd389ecbb19d7ac1548b907063f320ddff97cb5 /mdoc_validate.c | |
parent | 23898d93c7914bc2b07dc60fde156bdff597205b (diff) | |
download | mandoc-3bc2083f7ee493642602f9dcee0f82ecbcca4c85.tar.gz |
Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. This
will make it easy for re-entrant parsing of `Ta' macros to fit in with
standard closure rules.
Added some more regressions for `Bl -column'. Note that one should
fail, as documented in the TODO file.
Recorded change of AST BNF in mdoc.3.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index ce90c0f3..8beae48a 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -928,6 +928,7 @@ post_an(POST_ARGS) static int post_it(POST_ARGS) { + /* FIXME: use mdoc_list! */ int type, i, cols; struct mdoc_node *n, *c; @@ -1017,15 +1018,16 @@ post_it(POST_ARGS) return(0); break; case (MDOC_Column): - if (NULL == mdoc->last->head->child) - if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOARGS)) - return(0); - if (mdoc->last->body->child) - if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_BODYLOST)) + assert(NULL == mdoc->last->head->child); + if (NULL == mdoc->last->body->child) + if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY)) return(0); + + /* Count up the number of columns. */ c = mdoc->last->child; - for (i = 0; c && MDOC_HEAD == c->type; c = c->next) - i++; + for (i = 0; c; c = c->next) + if (MDOC_BODY == c->type) + i++; if (i < cols) { if ( ! mdoc_vmsg(mdoc, MANDOCERR_ARGCOUNT, |