summaryrefslogtreecommitdiffstats
path: root/mdoc_state.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
commit5fbabdf032b370e99e8685958b6e15eb3b2ff0f7 (patch)
tree56bbeb9f07b66610d5173e36db18df3fba402155 /mdoc_state.c
parent90c0bcfc5ca59192e72f849591c6ec10e8048bf0 (diff)
downloadmandoc-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_state.c')
-rw-r--r--mdoc_state.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdoc_state.c b/mdoc_state.c
index fb21a36e..99230b22 100644
--- a/mdoc_state.c
+++ b/mdoc_state.c
@@ -16,6 +16,7 @@
*/
#include <sys/types.h>
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -154,7 +155,6 @@ static const state_handler __state_handlers[MDOC_MAX - MDOC_Dd] = {
NULL, /* En */
NULL, /* Dx */
NULL, /* %Q */
- NULL, /* br */
NULL, /* sp */
NULL, /* %U */
NULL, /* Ta */
@@ -168,9 +168,10 @@ mdoc_state(struct roff_man *mdoc, struct roff_node *n)
{
state_handler handler;
- if (n->tok == TOKEN_NONE)
+ if (n->tok == TOKEN_NONE || n->tok < ROFF_MAX)
return;
+ assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
if ( ! (mdoc_macros[n->tok].flags & MDOC_PROLOGUE))
mdoc->flags |= MDOC_PBODY;