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 | 6cff4f9d35431af8274477e9e1cd8dbb193f159a (patch) | |
tree | 915d9a7213a5eb4bcdd275befff13cc2a5e27720 /mdoc_html.c | |
parent | 094f88dec3c7fd9ede485ab47df6943bd7686330 (diff) | |
download | mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.gz mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.zst mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.zip |
Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index f68c0e93..ea51b385 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.280 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.281 2017/05/04 17:48:29 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -237,7 +237,6 @@ static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_Dd] = { {mdoc_quote_pre, mdoc_quote_post}, /* En */ {mdoc_xx_pre, NULL}, /* Dx */ {mdoc__x_pre, mdoc__x_post}, /* %Q */ - {mdoc_sp_pre, NULL}, /* br */ {mdoc_sp_pre, NULL}, /* sp */ {mdoc__x_pre, mdoc__x_post}, /* %U */ {NULL, NULL}, /* Ta */ @@ -394,6 +393,16 @@ print_mdoc_node(MDOC_ARGS) t = h->tag; } assert(h->tblt == NULL); + if (n->tok < ROFF_MAX) { + switch(n->tok) { + case ROFF_br: + mdoc_sp_pre(meta, n, h); + break; + default: + abort(); + } + break; + } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); if (mdocs[n->tok].pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) @@ -415,7 +424,9 @@ print_mdoc_node(MDOC_ARGS) case ROFFT_EQN: break; default: - if (mdocs[n->tok].post == NULL || n->flags & NODE_ENDED) + if (n->tok < ROFF_MAX || + mdocs[n->tok].post == NULL || + n->flags & NODE_ENDED) break; (*mdocs[n->tok].post)(meta, n, h); if (n->end != ENDBODY_NOT) @@ -1005,7 +1016,7 @@ mdoc_bd_pre(MDOC_ARGS) */ switch (nn->tok) { case MDOC_Sm: - case MDOC_br: + case ROFF_br: case MDOC_sp: case MDOC_Bl: case MDOC_D1: |