diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
commit | 5fbabdf032b370e99e8685958b6e15eb3b2ff0f7 (patch) | |
tree | 56bbeb9f07b66610d5173e36db18df3fba402155 /mdoc_validate.c | |
parent | 90c0bcfc5ca59192e72f849591c6ec10e8048bf0 (diff) | |
download | mandoc-5fbabdf032b370e99e8685958b6e15eb3b2ff0f7.tar.gz |
Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 23 |
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, |