summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index ed1c8017..485b1689 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -227,7 +227,6 @@ static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] = {
post_en, /* En */
post_xx, /* Dx */
NULL, /* %Q */
- post_par, /* br */
post_par, /* sp */
NULL, /* %U */
NULL, /* Ta */
@@ -327,6 +326,18 @@ mdoc_node_validate(struct roff_man *mdoc)
/* Call the macro's postprocessor. */
+ if (n->tok < ROFF_MAX) {
+ switch(n->tok) {
+ case ROFF_br:
+ post_par(mdoc);
+ break;
+ default:
+ abort();
+ }
+ break;
+ }
+
+ assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
p = mdoc_valids + n->tok;
if (*p)
(*p)(mdoc);
@@ -1310,7 +1321,7 @@ post_bl_block(POST_ARGS)
switch (nc->tok) {
case MDOC_Pp:
case MDOC_Lp:
- case MDOC_br:
+ case ROFF_br:
break;
default:
nc = NULL;
@@ -2064,7 +2075,7 @@ post_prevpar(POST_ARGS)
if (n->prev->tok != MDOC_Pp &&
n->prev->tok != MDOC_Lp &&
- n->prev->tok != MDOC_br)
+ n->prev->tok != ROFF_br)
return;
if (n->tok == MDOC_Bl && n->norm->Bl.comp)
return;
@@ -2085,7 +2096,7 @@ post_par(POST_ARGS)
struct roff_node *np;
np = mdoc->last;
- if (np->tok != MDOC_br && np->tok != MDOC_sp)
+ if (np->tok != ROFF_br && np->tok != MDOC_sp)
post_prevpar(mdoc);
if (np->tok == MDOC_sp) {
@@ -2103,8 +2114,8 @@ post_par(POST_ARGS)
if (np->tok != MDOC_Sh && np->tok != MDOC_Ss)
return;
} else if (np->tok != MDOC_Pp && np->tok != MDOC_Lp &&
- (mdoc->last->tok != MDOC_br ||
- (np->tok != MDOC_sp && np->tok != MDOC_br)))
+ (mdoc->last->tok != ROFF_br ||
+ (np->tok != MDOC_sp && np->tok != ROFF_br)))
return;
mandoc_vmsg(MANDOCERR_PAR_SKIP, mdoc->parse,