From 6cff4f9d35431af8274477e9e1cd8dbb193f159a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 4 May 2017 17:48:28 +0000 Subject: Parser reorg: Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here. --- mdoc_state.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mdoc_state.c') diff --git a/mdoc_state.c b/mdoc_state.c index c3d23197..3938f239 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_state.c,v 1.5 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: mdoc_state.c,v 1.6 2017/05/04 17:48:29 schwarze Exp $ */ /* * Copyright (c) 2014, 2015, 2017 Ingo Schwarze * @@ -16,6 +16,7 @@ */ #include +#include #include #include @@ -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; -- cgit v1.2.3-56-ge451